Magento custom emails

Featured Image

Ever wanted to “just send the email” using the built in email features in Magento? Ever hit the wall trying to do something with Magento? OK, I know the answer to the other one, just had to ask :). Anyhow, sending the emails with Magento turned out to be a process of “just” a few hours of tracing Magento code.

I cant wait for smart comments like, “few hours, huh its so easy…”. Yea, thats the beauty of Magento… few hours of bashing your head against the wall while you are sipping the 4th cup of coffee until the solution hits you. Interesting do, just when you get the hang of it, Magento gets you this “have you tried this” attitude :).

What am I talking about? Scenario: I want to create email template named activecodeline_custom_email1.html, I want to pass few variables to it during runtime, I want to send emails programmaticaly. I dont want to create 56 lines of xml file just to call one template.

Here is how.

...
/*
 * Loads the html file named 'custom_email_template1.html' from
 * app/locale/en_US/template/email/activecodeline_custom_email1.html
 */
$emailTemplate  = Mage::getModel('core/email_template')
						->loadDefault('custom_email_template1');
//Create an array of variables to assign to template
$emailTemplateVariables = array();
$emailTemplateVariables['myvar1'] = 'Branko';
$emailTemplateVariables['myvar2'] = 'Ajzele';
$emailTemplateVariables['myvar3'] = 'ActiveCodeline';
/**
 * The best part :)
 * Opens the activecodeline_custom_email1.html, throws in the variable array
 * and returns the 'parsed' content that you can use as body of email
 */
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
/*
 * Or you can send the email directly,
 * note getProcessedTemplate is called inside send()
 */
$emailTemplate->send('john@someemail.com','John Doe', $emailTemplateVariables);
...

And here we go again, nothing without xml files :) -In order for above piece of code to work, you need to add an entry to your config.xml file like shown below.

...
<global>
	<template>
		<email>
			<custom_email_template1 module="SampleModule1">
				<label>ActiveCodeline custom email module</label>
				<file>activecodeline_custom_email1.html</file>
				<type>html</type>
			</custom_email_template1>
		</email>
	</template>
</global>
...

And lets not forget the email template itself, app/locale/en_US/template/email/activecodeline_custom_email1.html.

<!--@subject ActiveCodeline custom email module @-->
<div>
<h1>ActiveCodeline custom email example by Branko Ajzele</h1>
<p>Hi there {{var myvar1}} {{var myvar2}} from {{var myvar3}}. This is just some example template to test custom email module.</p>
</div>

Hope this was helpful. Cheers.

49
Top

Care to rate this post?

Author

Branko Ajzele

Ex Inchooer

Worked at Inchoo as a Backend Developer/CTO from 2008 to 2013

Other posts from this author

Discussion 49 Comments

Add Comment
  1. Thank you for this tuto, but don’t you miss a

    $emailTemplate->setSenderName(‘my name’);
    $emailTemplate->setSenderEmail(‘my@email.com’);

    before to send?

  2. Kim Delmote

    François Gueguen is right, it does need the send name and sender email.
    I would like to know though if there is a way to get those details from magento

  3. Neo

    Hi, thanks very much for your trick.
    I want to send an email from Order View Page in admin panel. I tried to use your trick, but it did not work. I am confused that which config.xml I should change. Please help me.

  4. the config.xml of your module from the etc. folder

  5. Thanks for the tip. Just what I was looking for! Cheers

  6. westlifelove

    ActiveCodeline custom email module
    activecodeline_custom_email1.html
    html

    xml?????

  7. westlifelove

    $emailTemplate->send(‘john@someemail.com’,’John Doe’, $emailTemplateVariables);

    send() config?

  8. where does the custom_email_template1.html file goes?

  9. How do you make a new field required?

  10. Bregoiu

    Nice article, thank you!

    How do you pass the locale information with this technique?

  11. Kat

    Thanks Branko!

  12. i am using default template but the problem is i get mail but comments are not showing in that mail,
    how can i resolve the issue
    all details are mailing to me but comments are not in that mail
    hope u understood the problem i am having with mailing

  13. haltabush

    Nice tutorial, thank you!
    Can we use it as usual in Magento, I mean can we rewrite it from the administration panel for the different languages?

  14. As François Gueguen said before, you must use :

    $emailTemplate->setSenderName(‘NAME’);
    $emailTemplate->setSenderEmail(‘EMAIL@DOMAIN.com’);
    $emailTemplate->setTemplateSubject(‘STATUS CHANGED’);

    Because the function isValidForSend is called when executing the send() function.

  15. atoz

    Great work Buddy.
    But I want to attach one pdf with this mail.:)

    How to do that ?
    Please help.

  16. haltabush

    Hi Atoz,
    Maybe you can try something like

     $at = $mail->createAttachment($pdf->render());
    

    ?

    You should have a look there :
    http://www.magentocommerce.com/boards/viewthread/10762/P45/
    That’s a bit old, but that’s exactly your problem.

  17. Miro

    It is silly to wait for “smart comments like, “few hours, huh its so easy…”” :) In the modern times we use internet and if we do not know something just ask Google :)

    This introduction is great clounade

  18. atoz

    Haii haltabush,
    Thanks a lot for your support. It worked great . Thanks Buddy…….

  19. Shani

    H,
    I’ve tried to add a new Email Template file (activecodeline_custom_email1.html) to the folder “/app/locale/en_US/template/email” and use it according to the instructions here, but after I did that the New Email Template page in the admin area stoped working… It looks like the page start to load the templates to the
    Load default template- Template dropdown and have an error while doing that so the page stop there (I’m adding a print screen).

    Iv’e tried to delete the “activecodeline_custom_email1.html” file from “/app/locale/en_US/template/email” and clean the cache but it didn’t fixed the problem.

    How can I fix this?

    Buy the way – I’m using Magento ver. 1.4.0.1

  20. Shani

    I’ll really appreciate some help

  21. Joe A

    Sorry. Newbie question here.

    Where are the php and xml files located at?

    Thanks
    Joe

  22. Rithy

    Wow! It’s the great tip I want!
    In the magento document is not good as this 1!
    before I spend 2 days to do sending email in magento and it’s not working!
    After I found this, I just spend 1 hour to do!

    Cheer,
    Rithy

  23. It´s works for me!!
    BUUUUUUUUUUUUUUUUUT its required that u clear the cache even don´t use it via admin.

    execute “rm -fr var/cache/*”

    I worked 2 days in this problem! =/

    ps. Im sorry by my English.

  24. Alidine

    Hi,
    I followed this tuto, but still can’t get it work even if I add these lines
    $emailTemplate->setSenderName(‘Test’);
    $emailTemplate->setSenderEmail(‘somemail@domain.com’);
    $emailTemplate->setTemplateSubject(‘STATUS CHANGED’);
    How can I check if the operation is successful?

  25. mark

    hi to all,
    i created a custom module in front end. any user can post what they thinking in mind about website.
    i used ur script the mail is not going…the final result will false.soo please help me…
    In that nothing is their just a using a mail function..no need to interact with the database..just a simple script..

  26. Awesome

    Thank you

  27. vipin

    thnx a lot

  28. Naleen Subedi

    If you want to just change Email Subject as posted from subject field–

    - Go to System> Transactional Emails
    - Click your template to Edit
    - delete your static Email subject and replace with
    {{var data.subject}}

    Here, You should have field with name “subject”

  29. Great tutorial, but no emails are sent and no errors are generated.

    Any help would be appreciated. I’ve literally copied the code as is, no customization what so ever, just to check this solution works. I can provide code if need be.

    To point out, I’ve placed this within my own controller – e.g. email/enquiry/hello

  30. Monica

    Thanks for the awesome post! Do you know how I would add the Customer’s Company Name (from Billing Address) in an email template’s subject line?

  31. Thank you very much
    I’m very happy

  32. [quote]
    H,
    I’ve tried to add a new Email Template file (activecodeline_custom_email1.html) to the folder “/app/locale/en_US/template/email” and use it according to the instructions here, but after I did that the New Email Template page in the admin area stoped working… It looks like the page start to load the templates to the
    Load default template- Template dropdown and have an error while doing that so the page stop there (I’m adding a print screen).

    Iv’e tried to delete the “activecodeline_custom_email1.html” file from “/app/locale/en_US/template/email” and clean the cache but it didn’t fixed the problem.

    How can I fix this?

    Buy the way – I’m using Magento ver. 1.4.0.1

    [/quote]

    True.
    Generates error_log

    [18-Aug-2011 07:14:01] PHP Fatal error: Class ‘Mage_SampleModule1_Helper_Data’ not found in /home/public_html/app/Mage.php on line 523

  33. Rahul D

    Thanks a Lot….
    Awesome peace of Code :) :) :)

  34. Thanks for the code. I’ve got one problem though. The email works and sends fine but now when I log into the backend and go to System > Transactional Emails > and click ‘Add new template’ the page seems to crash. The template dropdown gets rendered but with no options and everything after that fails to load.

    Just wondering if anyone else has had that problem?

    I think it could be down to my xml. I’m not sure what I have in the module=”” is correct. My module is in Local > Optimise > Requestcallback

    <global>
        <template>
            <email>
                <optimise_orderform module="Orderform">
                    <label>Optimise Orderform</label>
                    <file>optimise_orderform.html</file>
                    <type>html</type>
                </optimise_orderform>
            </email>
        </template>
    </global>
    
  35. Oops pasted from wrong confix.xml:

    <global>
        <template>
            <email>
                <Optimise_Requestcallback module="optimise_requestcallback">
                    <label>Optimise RequestCallback</label>
                    <file>optimise_requestcallback.html</file>
                    <type>html</type>
                </Optimise_Requestcallback>
            </email>
        </template>
    </global>
    
  36. Here is a detailed blog written magento transactional emails

    http://www.excellencemagentoblog.com/magento-advanced-transactional-email-templates

  37. Baboo

    The admin Transactional Email-s don’t work anymore definitly. Does anyone have solution for this?

    Thanks for the great article though, it works great, but this is the problem now.

  38. If you are having trouble with the Transactional Emails in Admin try removing the module attrubute in your config.xml. For example, if you’re using the sample code change line 5 from this:

    <custom_email_template1 module="SampleModule1">
    

    to this:

    <custom_email_template1>
    

    This solved the issue for me.

  39. I’m doing:

    $emailTemplate = Mage::getModel(‘core/email_template’)->loadDefault(‘send_to_requests_template’);
    $emailTemplate->setSenderName(“Some Name”);
    $emailTemplate->setSenderEmail(“some@mail.com”);
    $emailTemplate->setTemplateSubject($this_>__(“Some Subject!”));
    $emailTemplateVariables = array();
    $emailTemplateVariables['zip'] = “….”;
    $emailTemplate->send($request['email'], “Mike Old”, $emailTemplateVariables);

    but mail are never been delivered. I have checked the spam folder, nothing, I have checked the smtp settings from magento, nothing…. I’m doing smthg wrong?
    thx

  40. kalaivani

    Hi , thank you for this great tutorial.Can you tell me How to integrate Freshbook – Magento ?

  41. Hi all,

    I want to apply this custom email block to my footer.phtml page for sending the custom email, can anyone help me…

    thanks
    Rishabh

  42. mike

    I really appreciate the guidance but you REALLY need to incorporate Brian’s advice from 12-01-2012 at 22:15 . This was a very odd bug to try to fix.

  43. Gaurav

    Me too really Apprecialte Brian’s advice from 12-01-2012 at 22:15 . I was trying to resolve this issue from the past 1 week. I got it working.
    Thanks

  44. Rowena

    Thanks a lot for the great tutorial on Magento custom emails. This is very helpful for a newbie like me.

  45. Nins

    How to add an image in email template

  46. Works fine! However, how do I use it within the Transitional E-mails? I mean, want to create a e-mail template on the admin and use it with the code. How to?

  47. I have followed the above guidelines to make a custom email template, but its not working could any one help? i am not getting any email on reciever@gmail.com
    I am sending an email from view.phtml
    my codings are as follows
    first i add in app/etc/config.xml within the tags of global i put following code

    &lt;template&gt;
            &lt;email&gt;
                &lt;custom_email_template1 module=&quot;SampleModule1&quot;&gt;
                    &lt;label&gt;ActiveCodeline custom email module&lt;/label&gt;
                    &lt;file&gt;activecodeline_custom_email1.html&lt;/file&gt;
                    &lt;type&gt;html&lt;/type&gt;
                &lt;/custom_email_template1&gt;
            &lt;/email&gt;
        &lt;/template&gt;
    

    then i add in my view.phtml

    $emailTemplate  = Mage::getModel('core/email_template')
                            -&gt;loadDefault('custom_email_template1');
    $emailTemplateVariables = array();
    $emailTemplateVariables['customerName'] = $name;
    $emailTemplateVariables['orderNo'] = $rand;
    $emailTemplateVariables['address'] = $address;
    $emailTemplateVariables['city'] = $city;
    $emailTemplateVariables['phone'] = $phone;
    $emailTemplateVariables['mobile'] = $mobile;
    $emailTemplateVariables['productName'] = 'ActiveCodeline';
    $emailTemplateVariables['productSku'] = $sku;
    $emailTemplateVariables['comments'] = $comments;
    $processedTemplate = $emailTemplate-&gt;getProcessedTemplate($emailTemplateVariables);
    $emailTemplate-&gt;setSenderName('sender name');
    $emailTemplate-&gt;setSenderEmail('sender@gmail.com');
    $emailTemplate-&gt;send('reciver@gmail.com','John Doe', $emailTemplateVariables);
    

    i made a new email template file in app/locale/en_US/template/email/activecodeline_custom_email1.html
    with following code

    &lt;!--@subject  {{var store.getFrontendName()}}: Invoice # {{var invoice.increment_id}} for Order # {{var order.increment_id}} @--&gt;
    &lt;!--@vars
    {&quot;store url=\&quot;\&quot;&quot;:&quot;Store Url&quot;,
    &quot;var logo_url&quot;:&quot;Email Logo Image Url&quot;,
    &quot;var logo_alt&quot;:&quot;Email Logo Image Alt&quot;,
    &quot;htmlescape var=$order.getCustomerName()&quot;:&quot;Customer Name&quot;,
    &quot;var store.getFrontendName()&quot;:&quot;Store Name&quot;,
    &quot;store url=\&quot;customer/account/\&quot;&quot;:&quot;Customer Account Url&quot;,
    &quot;var invoice.increment_id&quot;:&quot;Invoice Id&quot;,
    &quot;var order.increment_id&quot;:&quot;Order Id&quot;,
    &quot;var order.billing_address.format('html')&quot;:&quot;Billing Address&quot;,
    &quot;var payment_html&quot;:&quot;Payment Details&quot;,
    &quot;var order.shipping_address.format('html')&quot;:&quot;Shipping Address&quot;,
    &quot;var order.shipping_description&quot;:&quot;Shipping Description&quot;,
    &quot;layout area=\&quot;frontend\&quot; handle=\&quot;sales_email_order_invoice_items\&quot; invoice=$invoice order=$order&quot;:&quot;Invoice Items Grid&quot;,
    &quot;var comment&quot;:&quot;Invoice Comment&quot;}
    @--&gt;
    &lt;!--@styles
    body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
    @--&gt;
    &lt;body style=&quot;background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;&quot;&gt;
    &lt;div style=&quot;background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;&quot;&gt;
    &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; height=&quot;100%&quot; width=&quot;100%&quot;&gt;
    &lt;tr&gt;
        &lt;td align=&quot;center&quot; valign=&quot;top&quot; style=&quot;padding:20px 0 20px 0&quot;&gt;
            &lt;!-- [ header starts here] --&gt;
            &lt;table bgcolor=&quot;#FFFFFF&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;0&quot; width=&quot;650&quot; style=&quot;border:1px solid #E0E0E0;&quot;&gt;
                &lt;tr&gt;
                    &lt;td valign=&quot;top&quot;&gt;&lt;a href=&quot;{{store url=&quot;&quot;}}&quot;&gt;&lt;img src=&quot;{{var logo_url}}&quot; alt=&quot;{{var logo_alt}}&quot; style=&quot;margin-bottom:10px;&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;&lt;/td&gt;
                &lt;/tr&gt;
            &lt;!-- [ middle starts here] --&gt;
                &lt;tr&gt;
                    &lt;td valign=&quot;top&quot;&gt;
                        &lt;h1 style=&quot;font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;&quot;&quot;&gt;Hello, {{htmlescape var customerName}}&lt;/h1&gt;
                        &lt;p style=&quot;font-size:12px; line-height:16px; margin:0;&quot;&gt;
                            Thank you for your order from {{var store.getFrontendName()}}.
                            Once your package ships we will send an email with a link to track your order.
                            If you have any questions about your order please contact us at &lt;a href=&quot;mailto:{{config path='trans_email/ident_support/email'}}&quot; style=&quot;color:#1E7EC8;&quot;&gt;{{config path='trans_email/ident_support/email'}}&lt;/a&gt; or call us at &lt;span class=&quot;nobr&quot;&gt;{{config path='general/store_information/phone'}}&lt;/span&gt; Monday - Saturday, 10am - 8pm PST.
                        &lt;/p&gt;
                        &lt;p style=&quot;font-size:12px; line-height:16px; margin:0;&quot;&gt;Your order confirmation is below. Thank you again for your business.&lt;/p&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td&gt;
                        &lt;h2 style=&quot;font-size:18px; font-weight:normal; margin:0;&quot;&gt;Your Order #{{var orderNo}}(Placed on {{var dateNtime}} PKT)&lt;/h2&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td&gt;
                        &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;650&quot;&gt;
                            &lt;thead&gt;
                                &lt;tr&gt;
                                    &lt;th align=&quot;left&quot; width=&quot;325&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Billing Information:&lt;/th&gt;
                                    &lt;th width=&quot;10&quot;&gt;&lt;/th&gt;
                                    &lt;th align=&quot;left&quot; width=&quot;325&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Payment Method:&lt;/th&gt;
                                &lt;/tr&gt;
                            &lt;/thead&gt;
                            &lt;tbody&gt;
                            &lt;tr&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    {{var customerName}}&lt;br&gt;
                                    {{var address}}&lt;br&gt;
                                    {{var city}}&lt;br&gt;
                                    Phone:  {{var phone}}&lt;br&gt;
                                    Mobile: {{var mobile}}
                                &lt;/td&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    &lt;strong&gt;Cash On Delivery&lt;/strong&gt;
                                &lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;/tbody&gt;
                        &lt;/table&gt;
                        &lt;br/&gt;
                        &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt;
                            &lt;thead&gt;
                            &lt;tr&gt;
                                &lt;th align=&quot;left&quot; width=&quot;325&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Shipping Information:&lt;/th&gt;
                                &lt;th width=&quot;10&quot;&gt;&lt;/th&gt;
                                &lt;th align=&quot;left&quot; width=&quot;325&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Shipping Method:&lt;/th&gt;
                            &lt;/tr&gt;
                            &lt;/thead&gt;
                            &lt;tbody&gt;
                            &lt;tr&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    {{var customerName}}&lt;br&gt;
                                    {{var address}}&lt;br&gt;
                                    {{var city}}&lt;br&gt;
                                    Phone:  {{var phone}}&lt;br&gt;
                                    Mobile: {{var mobile}}
                                    &amp;nbsp;
                                &lt;/td&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    Free Shipping - Free Delivery Across Pakistan, No Hidden Charges Delivery within 24-48 Hours Payment on Delivery by TCS.
                                &lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;/tbody&gt;
                        &lt;/table&gt;
                        &lt;br/&gt;
                        &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt;
                            &lt;thead&gt;
                            &lt;tr&gt;
                                &lt;th align=&quot;left&quot; width=&quot;325&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Item&lt;/th&gt;
                                &lt;th width=&quot;100&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Sku&lt;/th&gt;
                                &lt;th width=&quot;100&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Quantity&lt;/th&gt;
                                &lt;th align=&quot;left&quot; width=&quot;135&quot; bgcolor=&quot;#EAEAEA&quot; style=&quot;font-size:13px; padding:5px 9px 6px 9px; line-height:1em;&quot;&gt;Subtotal&lt;/th&gt;
                            &lt;/tr&gt;
                            &lt;/thead&gt;
                            &lt;tbody&gt;
                            &lt;tr&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    {{var productName}}
                                    &amp;nbsp;
                                &lt;/td&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    {{productSku}}
                                    &amp;nbsp;
                                &lt;/td&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    {{productQuantity}}
                                    &amp;nbsp;
                                &lt;/td&gt;
                                &lt;td valign=&quot;top&quot; style=&quot;font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;&quot;&gt;
                                    {{productPrice}
                                &lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;tr&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td&gt;Subtotal&lt;/td&gt;
                                &lt;td&gt;{{productPrice}}&lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;tr&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td&gt;Shipping &amp; Handling&lt;/td&gt;
                                &lt;td&gt;Rs. 0.00&lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;tr&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                                &lt;td&gt;&lt;strong&gt;Grand Total&lt;/strong&gt;&lt;/td&gt;
                                &lt;td&gt;&lt;strong&gt;{{productPrice}}&lt;/strong&gt;&lt;/td&gt;
                            &lt;/tr&gt;
                            &lt;/tbody&gt;
                        &lt;/table&gt;
                        &lt;p style=&quot;font-size:12px; margin:0 10px 10px 0;&quot;&gt;{{var comment}}&lt;/p&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td bgcolor=&quot;#EAEAEA&quot; align=&quot;center&quot; style=&quot;background:#EAEAEA; text-align:center;&quot;&gt;&lt;center&gt;&lt;p style=&quot;font-size:12px; margin:0;&quot;&gt;Thank you again, &lt;strong&gt;{{var store.getFrontendName()}}&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/center&gt;&lt;/td&gt;
                &lt;/tr&gt;
            &lt;/table&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/div&gt;
    &lt;/body&gt;
    

    Kindly sort out my mistake
    thanks

  48. Rafael

    Not worked for me, but there is a great example in magento code: Mage/Contacts/controllers/IndexController.php see “postAction” function

    This example from magento code worked for me!

  49. Marj

    all emails are marked as spam. anyone can help me to fix this?

Add Your Comment

Please wrap all source codes with [code][/code] tags.
Top