Add customer phone on the commerce.email.order_rcvdmerch.subject

I want to add the phone number of my customer inside the received merchant email subject.

It’s looking easy to do.

On the order-to-merchant.twig file, I’m setting this line :

 {% block subject %}{{ lex('commerce.email.order_rcvdmerch.subject', { name: billing_address.fullname, id: order.reference, phone: shipping_address.phone }) }}{% endblock %}

Inside the MODX Lexicon commerce.email.order_rcvdmerch.subject entry, I’m setting this :

Order #[[+id]] - [[+name]] - [[+phone]]

But the [[+phone]] placeholder stay empty.
I don’t understand because elsewhere on the order-to-merchant email body, I’m using the field phone: shipping_address.phone througth lexicon with success.

Is there a kind of limitation for the usable placeholders for the subject email ?

The subject in the template file is used in the <title> - the actual email subject is managed in Configuration > Statuses > Payment Received status change > email actions. You’ll need to add the phone number there as well.

1 Like

Thanks !
I thought there was a trick somewhere :slight_smile:

1 Like