Magento 1.9 – Include Image in Transactional Email

email-templatesmagento-1.9

I would like to give new subscribers a $5 coupon for subscribing to the newsletter.
The best way (in my mind) to do this is to create a transactional email template (System > Transactional Emails) and set it to email in lieu of the default Newsletter Subscription Confirmation email.
The $5 coupon will be redeemed in a physical store so it will need to have a scannable barcode instead of a simple promo code which is why it will need to be an image.
I'm asking:
1) Is this possible?
2) Is there a better way of doing this?
3) If this is the best way, how do I embed an image into the email message?
Please let me know your thoughts, I greatly appreciate any help you can give me.

Thank you!

Best Answer

I think your proposed solution will work without editing template files in your theme. Below I have created a simple sample template for you to paste in a new template.

System > Transactional Emails > Add New Template

Paste this into Template Styles

body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }

Below is the whole template to paste in to Template Content.

<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
    <tr>
        <td align="center" valign="top" style="padding:20px 0 20px 0">
            <!-- [ header starts here] -->
            <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
                <tr>
                    <td valign="top">
                        <a href="{{store url=""}}" style="color:#1E7EC8;"><img src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/></a>
                    </td>
                </tr>
                <!-- [ middle starts here] -->
                <tr>
                    <td valign="top">
                        <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Thank you for subscribing to our newsletter.</h1>
                         <p>Below you will find your $5 coupon to use in store.</p>
            <p><img src="[THE ABSOLUTE URL FOR YOUR IMAGE EG: http://www.melissastore.com/media/coupon.png" alt="$5 Off Coupon" title="Print This Email to Claim your Coupon In Store" /></p>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</div>

Note the line that contains

<img src="[THE ABSOLUTE URL FOR YOUR IMAGE EG: http://www.melissastore.com/media/coupon.png" alt="$5 Off Coupon" title="Print This Email to Claim your Coupon In Store" />

You need to substitute the src with your own image's url in the above code. Upload the image using your FTP client.

Related Topic