Creating a magento email template: custom static block not working

允我心安 提交于 2019-12-13 22:08:29

问题


I am creating a new email template to replace the defaults on Magento. Having taken some code directly I googled how to add static blocks and followed these basic and brief instructions:

http://www.webcenter.co.in/insert-cms-static-block-into-transactional-email-template-in-magento/

This didn't work for me and resulted in blank spaces when the email was sent and (when viewing the HTML file in chrome, the code appears separate:

Example of email previewed in chrome

I don't really understand why this is happening, other magento code works within the email (the 'What you ordered:' section successfully returns a table and all works perfectly).

Here is the HTML footer where all this takes place:

<!-- // FOOTER BLOCK HERE // -->
<td align="center" valign="top" id="footerContainer" style="padding:20px;">
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td style="text-align:center;">
        <p>Follow us to keep updated with all our exclusive offers and competitions!</p>
      </td>
    </tr>
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td width="20%">
              <a href="https://www.facebook.com/*****" title="***** Facebook" target="_blank" style="margin-left:40%;">
                <img src="https://www.*******.co.uk/media/******/Email_Icons/facebook.png" alt="Follow  on Facebook" height="20px" width="20px">
              </a>
            </td>
            <td width="20%">
              <a href="https://www.instagram.com/*****/" title="****** Instagram" target="_blank" style="margin-left:40%;">
                <img src="https://www.********.co.uk/media/****/Email_Icons/instagram.png" alt="Follow ******* on Instagram" height="20px" width="20px">
              </a>
            </td>
            <td width="20%">
              <a href="https://twitter.com/*******" title="******* Twitter" target="_blank" style="margin-left:40%;">
                <img src="https://www.********.co.uk/media/roco/Email_Icons/twitter.png" alt="Follow ******** on Twitter" height="20px" width="20px">
              </a>
            </td>
            <td width="20%">
              <a href="https://uk.pinterest.com/*******/" title="******* Pinterest" target="_blank" style="margin-left:40%;">
                <img src="https://www.******.co.uk/media/roco/Email_Icons/pintrest.png" alt="Follow ******* on Pinterest" height="20px" width="20px">
              </a>
            </td>
            <td width="20%">
              <a href="https://www.youtube.com/user/*******" title="***** YouTube" target="_blank" style="margin-left:40%;">
                <img src="https://www.*******.co.uk/media/*****/Email_Icons/youtube.png" alt="Follow ****** on Youtube" height="20px" width="20px">
              </a>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td style="text-align:center;">
        <p>This inbox is unattended so please don't reply to this email. Just visit our <a href="https://www.*****.co.uk/help" title="Help Pages" alt="Help Pages">Help Pages</a> if you need extra information. This is a service email and you are recieving
          it regardless of your marketing communication preferences.</p>
      </td>
    </tr>
  </table>

  <p>{{block type="cms/block" block_id="temp-email-tester" }}</p>
</td>
<!-- // FOOTER BLOCK ENDS HERE // -->

Any answers greatly appreciated!

来源:https://stackoverflow.com/questions/40358910/creating-a-magento-email-template-custom-static-block-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!