Skip to content

Instantly share code, notes, and snippets.

@versedi
Last active Oct 7, 2016
Embed
What would you like to do?
FIX-Magento-Untranslated-NonStyled-Newsletter-Subscription-Unsubscription-Emails-InlineCss-Not-Rendered-From-Backend.php
<?php
// app/code/core/Mage/Core/Model/Email/Template/Abtract.php
//example on sendUnsubscriptionEmail but has to be done everywhere.
/**
* Sends out unsubsciption email
*
* @return Mage_Newsletter_Model_Subscriber
*/
public function sendUnsubscriptionEmail()
{
if ($this->getImportMode()) {
return $this;
}
if(!Mage::getStoreConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE)
|| !Mage::getStoreConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY)
) {
return $this;
}
$translate = Mage::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
$translate->setTranslateInline(false);
$email = Mage::getModel('core/email_template');
// We need to initialize setDesignConfig to ensure the inline css
// is rendered from frontend area.
$email->setDesignConfig(array(
'area' => 'frontend',
'store' => $this->getStoreId()
));
$email->sendTransactional(
Mage::getStoreConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY),
$this->getEmail(),
$this->getName(),
array('subscriber'=>$this)
);
$translate->setTranslateInline(true);
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment