0

I am using this code to display customer_note in order confirmation email:

{{var order.getCustomerNote()|escape|nl2br}}

But it does not show up in the email. I also checked the value of customer_note in sales_order table to make sure it's not null. And i went to Order model:

vendor/magento/module-sales/Model/Order.php

And return a test string:

/**
 * Return customer_note
 *
 * @return string|null
 */
public function getCustomerNote()
{
    return "i was here!";
    return $this->getData(OrderInterface::CUSTOMER_NOTE);
}

Surprisingly i can see my test string show up in email.

Do you have any ideas why it doesnt work? Many thanks.

Harry
  • 1
  • 1

1 Answers1

0

Can you try this code

{{depend order_data.email_customer_note}}
    <table class="message-info">
        <tr>
            <td>
                {{var order_data.email_customer_note|escape|nl2br}}
            </td>
        </tr>
    </table>
{{/depend}}

THANKS.

Mohit Patel
  • 3,778
  • 4
  • 22
  • 52