Magento ignores email-inline.css (Transactional Emails)

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

I created a few custom emails and it didn’t work. The following code doesn’t work (it excludes the email-inline.css):

$mailTemplate->sendTransactional(
$templateID,
Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_REGISTER_EMAIL_IDENTITY, $storeId),
$customer->getEmail(),
$customer->getName(),
array(
‘customer’ => $customer,
‘shipping’ => $customer->getPrimaryShippingAddress(),
‘billing’ => $customer->getPrimaryBillingAddress(),
‘store’ => Mage::app()->getStore(

$this->getCustomerStoreId($customer)
),
),
$storeId
);

___________________________________________________

This is the code that you want to use:

$storeId = $this->getCustomerStoreId($customer);
$templateID = Mage::getModel(‘core/email_template’)->loadByCode(‘your code’)->getId();

$mailer = Mage::getModel(‘core/email_template_mailer’);
$emailInfo = Mage::getModel(‘core/email_info’);
$emailInfo->addTo($customer->getEmail(), $customer->getName());
$mailer->addEmailInfo($emailInfo);

// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_REGISTER_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);

$templateParams = array(
‘customer’ => $customer,
‘shipping’ => $customer->getPrimaryShippingAddress(),
‘billing’ => $customer->getPrimaryBillingAddress(),
‘store’ => Mage::app()->getStore(

$this->getCustomerStoreId($customer)
),
);
$mailer->setTemplateId($templateID);
$mailer->setTemplateParams($templateParams);
$mailer->send();

This entry was posted in Magento, PHP. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *