Sending emails with High Importance in Magento

I recently had to customize a transactional email and send it with High Importance in Magento 1.9. After googling around found this post explaining how to do it in Zend Mail.

Since Magento’s mail object extends Zend_Mail, here’s how it’s done in Magento.

$mailTemplate = Mage::getModel('core/email_template');
 
//get Zend_Mail and add Importance headers
$mailTemplate->getMail()
             ->addHeader('X-Priority', '1')
             ->addHeader('X-MSMail-Priority', 'High')
             ->addHeader('Importance', 'High');
 
$mailTemplate->setDesignConfig(array('area' => 'frontend'))         
            ->sendTransactional(
                $template_id,
                $sender,
                $mailto,
                null,
                $data
            );
...

Leave a Reply

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