In this case you need to rewrite the above specified class using your module. You can use this module. I love to call this module as Rkt_CustomerSPTemplateModifier
File : app\etc\modules\Rkt_CustomerSPTemplateModifier.xml
<config>
<modules>
<Rkt_CustomerSPTemplateModifier>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Customer />
</depends>
</Rkt_CustomerSPTemplateModifier>
</modules>
</config>
This file tells to magento that, I am going to include a module Rkt_CustomerSPTemplateModifier
in local code pool and it depends on Mage_Customer
mdoule.
File: app\code\local\Rkt/CustomerSPTemplateModifier/etc/config.xml
<config>
<modules>
<Rkt_CustomerSPTemplateModifier>
<version>1.0.0</version>
</Rkt_CustomerSPTemplateModifier>
</modules>
<global>
<models>
<customer>
<rewrite>
<customer>Rkt_CustomerSPTemplateModifier_Model_Customer</customer>
</rewrite>
</customer>
</models>
</global>
</config>
This configuration tells to magento that, it should use the custom class Rkt_CustomerSPTemplateModifier_Model_Customer
whenever it requires to use Mage_Customer_Model_Customer
.
Now we need to define our custom model class Rkt_CustomerSPTemplateModifier_Model_Customer
. For this.
File : app\code\local\Rkt/CustomerSPTemplateModifier/Model/Customer.php
<?php
/**
* Rewriting core class `Mage_Customer_Model_Customer`
*
* The methods which are defined inside this class will be used prior to those methods which are
* defined inside the class `Mage_Customer_Model_Customer`.
*
*/
class Rkt_CustomerSPTemplateModifier_Model_Customer extends Mage_Customer_Model_Customer
{
/**
* Send email with reset password confirmation link
*
* @return Mage_Customer_Model_Customer
*/
public function sendPasswordResetConfirmationEmail()
{
$storeId = $this->getStoreId();
if (!$storeId) {
$storeId = $this->_getWebsiteStoreId();
}
$customVar = $this->getCustomvar();
$customCollection= Mage::getModel('namespace_extension/customcollection')->load(5);
$this->_sendEmailTemplate(
self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY,
array(
'customer' => $this,
'customvar' => $customVar,
'customcollection' => $customCollection
),
$storeId
);
return $this;
}
}
That's it. A tiny module is successfully created. Now clear all caches and then try again.
First you need to understand how inline-css and non-inline-css work in magento.
For adding any inline-css using a separate file you define it using
{{inlinecss file="email-inline.css"}}
It will inject css defined in your file within style attribute of each tag with provided class.
So if you need to style button in your email, you need to define a class in email-inline.css like following:
.btn {
}
then you need to apply this class to an element in your template like following:
<input type="button" class="btn" />
Magento will automatically inject the css in style attribute before sending an email.
Reference
Best Answer
Use
{{trans "%orderDate" orderDate=$data.orderDate}}
in ur mail template & in PHP