我正在从管理端的 magento 自定义模块发送电子邮件。电子邮件正在工作,
但文件email-inline.css未加载......
当我使用前端的自定义模块时,它将发送完美的电子邮件,还包括email-inline.css文件,但在管理端不起作用......
<!--@subject ActiveCodeline custom email module @-->
{{template config_path="design/email/header"}}
{{inlinecss file="email-inline.css"}}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="action-content">
<h1>{{var title}},</h1>
<p>Your order <span class="no-link"># {{var mcode}}-{{var order.increment_id}}</span> has been declined from: <strong>{{var store_front_name}}</strong></p>
<p>Please review the reason for invoice declined.</p>
<h1>Reason</h1>
<p>{{var comment}}</p>
<p>
If you have any questions, please feel free to contact us at
<a href="mailto:{{var store_email}}">{{var store_email}}</a>
{{depend store_phone}} or by phone at <a href="tel:{{var phone}}">{{var store_phone}}</a>{{/depend}}.
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
{{template config_path="design/email/footer"}}
Run Code Online (Sandbox Code Playgroud)
小智 5
您现在可能已经解决了这个问题,但是当我尝试从 cronjob 发送自定义电子邮件时,我遇到了类似的问题。这是我必须做的:
// Set store
$previousStore = Mage::app()->getStore();
Mage::app()->setCurrentStore($_order->getStore()->getCode());
Mage::getDesign()->setArea('frontend');
/* Your email sending code */
// Restore config
Mage::app()->setCurrentStore($previousStore->getCode());
Run Code Online (Sandbox Code Playgroud)
这里的关键部分是setArea('frontend')允许 Magento 找到您的包/主题,即您的 CSS 通常所在的位置。
希望这可以帮助别人。
| 归档时间: |
|
| 查看次数: |
1652 次 |
| 最近记录: |