1
Answers
Vote up!
0
Vote down!

How to inlcude custom field on Customer profile into Commerce Order Confirmation Email

I followed this instruction to create custom field (phone number) on Customer Profile (Billing & Shipping Information)

http://www.drupalcommerce.org/user-guide/configuring-creating-customer-p...

But when customer receive the Order Confirmation Email, that custom field (phone number) not included on it.

I've tried edit the message
admin/structure/messages/manage/commerce_order_order_confirmation

but still not find a clue

Could anyone help me how to include custom field on order confirmation email?

Asked by: sibiru
on January 18, 2014

1 Answer

Vote up!
1
Vote down!

I have not tried this myself just yet, but I am pretty sure this can be achieved via 'tokens', which are text patterns that will automatically be replaced by the system. You will need the "Entity tokens" and the "Token" modules I believe. If you got Drupal Commerce via Drupal Kickstart, you should already have these installed.

So at
admin/structure/messages/manage/commerce_order_order_confirmation
underneath the "Add another item" button you should have a table with the text "Click a token to insert it into the field you've last clicked." above.
What you want in this table is to look into the

- [Current user]

Node entry (click it).
Then look for the field you want to at. I assume it will read something like

- [current-user:field-phone-number]

If you click that one, it should automatically be added to the text field above.

One reason it might not work is if you have selected a second entry that used underscores (_) instead of dashes (-). I've ran into this problem once before. Just try the other one in that case.

Hope this helps you solve your problem. (:

Answer by: Bird-Kid
Posted: Jan 18, 2014

Comments

"One reason it might not work is if you have selected a second entry that used underscores (_) instead of dashes (-). I've ran into this problem once before. Just try the other one in that case."

Yes I have use the - version seem not work
I will try using _ version

Thanks

- sibiru on January 18, 2014

if that still doesnt work, you might want to try using
[user:field-phone-number]
even though this token is not being displayed.

the 'user' (as opposed 'current-user') prefix is what is used in the default drupal email bodies, as can be seen at
admin/config/people/accounts
if you scroll down all the way.
maybe this one works? it should be the one with the dashes (-), but it cant hurt trying both dashes and underscores.

- Bird-Kid on January 18, 2014