1

How can i send a new Transactional Email with order information in the success.phtml? And how can i add custom order information?

2
  • Have you tried something?
    – Amit Bera
    May 12, 2015 at 12:23
  • @AmitBera i have create a new Tranactional Email in the adminpanel but cannot find the template in my files and don't know how i can send the email in the success page.
    – Esther
    May 12, 2015 at 12:35

1 Answer 1

1

I figure it out. I use this code to send the email in the phtml file

 $templateId = 2;
 $sendername = Mage::getStoreConfig('trans_email/ident_general/name');
 $senderemail = Mage::getStoreConfig('trans_email/ident_general/email');
 $sender = Array('name' => $sendername,
 'email' => $senderemail);
 //recepient

 $email = $email;
 $emailName = $name;
 $vars = Array();
 $vars = Array('tickets'=>$alle_tickets,'order_id'=>$order_id);
 $storeId = Mage::app()->getStore()->getId();
 $translate = Mage::getSingleton('core/translate');
 Mage::getModel('core/email_template')
 ->sendTransactional($templateId, $sender, $email, $emailName, $vars, $storeId);
 $translate->setTranslateInline(true);
 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.