Skip to content

Send Transaction Email Programatically

long time no post 😀

this is example how to send email transaction programatically, here we go!!

function sendTransactionalEmail($templateId,$recepientEmail,$recepientName,$vars)
{

$senderName = Mage::getStoreConfig(‘trans_email/ident_support/name’);
$senderEmail = Mage::getStoreConfig(‘trans_email/ident_support/email’);
$sender = array(‘name’ => $senderName,
’email’ => $senderEmail);

$store = Mage::app()->getStore()->getId();
$translate = Mage::getSingleton(‘core/translate’);
Mage::getModel(‘core/email_template’)
->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId);

$translate->setTranslateInline(true);
}

 

/* usage */

 

sendTransactionalEmail(2,’[email protected]’,’Ansyori B’,$_POST);

 

Share

Be First to Comment

Leave a Reply

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