Magento – Is that possible to add order comment in to order email

email-templatesmagento-1.9

Is that possible to add some code into email template so that custom/guest can see order comment in new order email?

Best Answer

If you have the order comment enabled and it is storing in the database properly, it is available in the template as the following macro:

{{var order.getEmailCustomerNote():escape|nl2br}}

the escape directive causes content to be sanitized so nasties can't come through

the nl2br directive keeps customer formatting (carriage returns) so it doesn't turn into one single annoying paragraph, or worse yet, the infinitely long string.

Related Topic