php - Magento - eMail variables -
i want customize order confirmation , can see can use if statements in template , otherwise can customize sendneworderemail()
function select 2 different templates based on information.
however wondering because use extensions offer customer delivery date , timeslot. use placeholder {{layout handle="deliverydate_email_information" order=$order}}
display delivery date. 1 looks in order confirmation:
thursday, 28. july, 8pm - 10pm
but want have these kind of information in 3 placeholders like:
{deliverydate_weekday} {deliverydate_date} {deliverydate_time}
does knows how can enhance magento system in way possible? assume can implementing own layout handle="deliverydate_email_information"
how do this?
thanks!
for {deliverydate_weekday} {deliverydate_date} {deliverydate_time}
you need define variables in sendneworderemail() shown below (define in custom module sending email or extend class. not edit code file):
//get value of $weekday, $deliverydate , $time extension $vars = array('deliverydate_weekday' => $weekday, 'deliverydate_date' => $deliverydate, 'deliverydate_time' => $time); $storeid = mage::app()->getstore()->getid(); $translate = mage::getsingleton('core/translate'); mage::getmodel('core/email_template') ->settemplatesubject($mailsubject) ->sendtransactional($templateid, $sender, $email, $name, $vars, $storeid);
you can use variables in template files :
{deliverydate_weekday} {deliverydate_date} {deliverydate_time}
you can write use if directive :
{{if order.getisnotvirtual()}} //some code {{else}} //some code {{/if}}
for more info can check these : https://magento.stackexchange.com/questions/5919/send-custom-mail-with-variable-via-script
http://excellencemagentoblog.com/blog/2011/11/25/magento-advanced-transactional-email-templates/
http://www.justwebdevelopment.com/blog/transactional-emails-variable-magento/
Comments
Post a Comment