Magento 1.9 sendTransactional() doesn't include CSS from email template
-
10-10-2020 - |
Question
I'm using sendTransactional() to send emails programmatically. All working fine besides the following line in the email template is not included
{{inlinecss file="email-inline.css"}}
Any fixes?
Solution
I found it out. It has to include ->setDesignConfig()
So the following code will include CSS file when sending out emails with sendTransactional().
Mage::getModel('core/email_template')
->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId)
;
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange