0

I am trying to send transactional emails from Magento through Listrack. I have override the default sendMessage function using Magento plugin method. Now I have to fetch template variables and process the data inside this function. I tried a lot and was not able to fetch any details regarding the template. Can anyone please help me to resolve this? sendMessage function is located in Transport.php file.

Nithin
  • 1
  • 1

1 Answers1

0

Replace the "Email Template Name" with your Template Name

$templateId = Mage::getModel('core/email_template')->loadByCode('Email Template Name')->getId();
$customerEmail = 'your mail Id';
$customerName = 'your name';
$senderName=Mage::getStoreConfig('trans_email/ident_general/name'); 
$senderEmail= Mage::getStoreConfig('trans_email/ident_general/email');
$sender = Array('name' => $senderName,'email' => $senderEmail);
$vars = array(
        'customerName' => $customerName,
        'date' => $date,
        'url'=>$url,
        'number'=>$number,
        'barcode'=>$serial_barcode,
        );

$translate = Mage::getSingleton('core/translate');
Mage::getModel('core/email_template')->sendTransactional($templateId, $sender, $customerEmail, $customerName, $vars, null);
$translate->setTranslateInline(true);
Riyaz
  • 26
  • 2