我从管理员端的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"}}
答案 0 :(得分:3)
你现在可能已经解决了这个问题,但是在尝试从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());
这里的关键部分是setArea('frontend')
,它允许Magento找到你的CSS通常所在的包/主题。
希望这可以帮助某人。