Add customer phone on the

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('', { name: billing_address.fullname, id: order.reference, phone: }) }}{% endblock %}

Inside the MODX Lexicon 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: 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