Adding a static block to a Magento transactional e-mail template

You can take customizing your Magento transactional e-mail templates even further by adding static blocks to the templates.

Creating the static block

Firstly, you will need to create a static block you wish to insert into your Magento e-mail template. Navigate to CMS | Static Blocks and click on the Add New Block button at the top-right corner of the screen.

Provide Block Title and Identifier (the example uses email_ as a prefix to help you know where the block is used), as shown in the following screenshot:

Creating the static block

Use the Content field to add content you would like to appear within the e-mail template itself. Once you're finished, click on the Save Block button at the top-right corner of the screen.

Adding the static block to the e-mail template

Once again, navigate to System | Transactional Emails and edit the New Order v2 template you created earlier. Locate the following code in the Template Content field:

If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
</p>
<p style="font-size:12px; line-height:16px; margin:0;">
Your order confirmation is below. Thank you again for your business.
</p>

Change this to include the following highlighted code, where the block_id value matches the Identifier value of the static block you created:

If you have any questions about your order please contact us at 
<a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
</p>
{{block type="cms/block" block_id="email_new-order" }}
<p style="font-size:12px; line-height:16px; margin:0;">
Your order confirmation is below. Thank you again for your business.
</p>

Click on the Save Template button at the top-right corner of the screen once more and generate a new e-mail for the new order template. You will see that the static block's content now appears within the template:

Adding the static block to the e-mail template
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.202.27