Does anyone have an idea or an overview of the placeholders available in email templates? I guess that it is a different set for newsletters and transactional emails. What I have found up to now (in the en_US locale templates):
Sales:
- order.getStoreGroupName(): Scope? Current value? Also available in other modules?
- order.getCustomerName()
- order.increment_id
- order.getBillingAddress().getName(): Name of the billing address
- order.getCreatedAtFormated(’long’): date of order creation?
- order.getBillingAddress().format(’html’): parameter for plain-text output?
- payment_html: content?
- order.getShippingAddress().format(’html’): parameter for plain-text output?
- order.shipping_address.format(’html’): difference between this and order.shipping_address.format(’html’)?
- order.getShippingDescription(): content?
- order.shipping_description: difference between this and order.getShippingDescription()?
- items_html: content?
- order.getEmailCustomerNote(): content?
- invoice.increment_id
- {{block type=’core/template’ area=’frontend’ template=’email/order/items_invoice.phtml’ invoice=$invoice order=$order}}: content?
- comment
- order.getStatusLabel()
- billing.getName(): content? difference between this and order.getBillingAddress().getName()?
- order.billing_address.format(’html’): difference between this and order.getBillingAddress().format(’html’)? parameter for plain-text output?
- {{block type=’core/template’ area=’frontend’ template=’email/order/items_shipment.phtml’ shipment=$shipment order=$order}}: content?
- {{block type=’core/template’ area=’frontend’ template=’email/order/shipment_track.phtml’ shipment=$shipment order=$order}}: content?
- shipment.increment_id
- creditmemo.increment_id
Newsletter:
- customer.name
- order.getStoreGroupName(): Not sure
- subscriber.getConfirmationLink()
Whishlist:
- message
- items: plain-text or html-formatted?
- customer.name
- addAllLink: maybe link to add entire wishlist to cart?
Is anybody able to confirm and/or correct/complete/comment the list above? I guess the placeholders / variables / function calls are related to the objects available in a particular scope. Maybe an overview of all available objects could also be helpful.
do not bring up the text I would expect. The first one should bring up; the ordered product lines, SKU, Qty
The second line should bring up : the shipping carrier, and tracking number.
But for whatever reason, even though I have modified copies of these blocks of text in by own shop called ‘qpar’, the default ones are fetched.
Does anyone have an idea or an overview of the placeholders available in email templates? I guess that it is a different set for newsletters and transactional emails.
There is no closed, complete set. If you need - you can extend it.
{{var }} is tightly related to variables given in sendTransactional() function, and correspond to them
i.e.
order.getCustomerName() does not work in templates where “order” object is not set as variable for sendTransactional()
if you want to extend these variables - you must:
A. Look for function sendTransactional() in correspondig .php file, and modify that place to your needs
find and grep unix tools are useful for looking
or
B. use {{block .....}} and make template that meet your needs. (That method is not store view aware, and for emails send from adminpanel, it looks in default/default for templates :(
But for whatever reason, even though I have modified copies of these blocks of text in by own shop called ‘qpar’, the default ones are fetched.
Julian
OK, I have reached similar problem too…
Transactional emails sent from adminpanel, seems do not fetch store package in {{block ....}}, and takes default/default. It should be taken from Order, Shipment, or Invoice, because adminpanel session has no knowledge of store view.
I digg it deeper… using order comment sending as example
code/core/Mage/Adminhtml/controllers/Sales/OrderController.php line 188
if ($notify && $comment) { Mage::getDesign()->setStore($order->getStoreId()); Mage::getDesign()->setArea('frontend'); } $order->sendOrderUpdateEmail($notify, $comment);
so store is set to order’s store, before sendOrderUpdateEmail
So the problem must be somewhere else… maybe is something improperly set in function blockDirective()
in file
code/core/Mage/Core/Model/Email/Template/Filter.php
Could someone more skilled look at this…
There is lack of store’s package definition
store is set, area is set, but package is not set to store’s package. Is still adminhtml package ( = default)
So i tried this modification (on sales example). It works for me {{block }} gets templates from store’s package
Thi is not a only palce, these modifications need to be done on few other files
Janek—I don’t think this was fixed in 1.1.1, am I correct? Whenever I send an email from the admin (selecting “notify customer"), the email arrives ok, but not all the variables switch to the store level. Some do—{{skin url="images/logo_email.gif"}} for example—but {{store url=""}} and {{store url="customer/account/"}} do not (they link to the magento admin, not the store URL.