How to Change email tpl

I am trying to change the commerce-order-email.tpl to add in the shipping address/ card message/delivery date to give the customer a full email of the order placed.
have found the tokens and added

print [commerce-order:commerce_customer_shipping];

but am getting error Parse error: syntax error, unexpected '[' in /home/enchant/public_html/sites/all/modules/commerce_email/theme/commerce-order-email.tpl.php on line 54

where line 54 is the line added.
I am not a php expert so can someone remind me what I have left out .

Posted: Nov 26, 2011


Brian on November 29, 2011

Can't you just add that in the email body in the rule that fires the email? [commerce-order:commerce-customer-shipping] is listed in the replacement patterns.

remus1 on November 29, 2011

Yes Brian
I have now built the email using the content area and using tokens.
only problem now is I am getting this error when you complete order

Notice: Undefined property: stdClass::$customer_name in commerce_email_tokens() (line 64 of /home/enchant/public_html/sites/all/modules/commerce_email/commerce_email.tokens.inc).

if you use the browser back button then finish the order again all works and email then sent.
have posted this on the email issues but no answer as yet.

neardark on December 5, 2011

Sounds like that token isn't available when the e-mail is sent, so you might try checking that the e-mail rule is fired last. Check its weight at:

Admin > Commerce > Config > Checkout Settings > Checkout Rules (tab)

See if it appears last (which is the default on a fresh install of Commerce I believe).

You might also check out: http://drupal.org/project/commerce_email

By the way, on my install of Commerce, I don't see customer_name as one of the available tokens to use on my stock install of Commerce. I just see [commerce-order:commerce_customer_billing].


remus1 on December 6, 2011

Thanks John

I think the problem is with that latest release of commerce_email 15th November 7x1.x-dev.
looking at the commits is says

Commit 2848130 on 7.x-1.x
by paul.linney
Added commerce-email:customer-name token Fixed missing keys on admin email for MimeMail Added token help to email configuration page

So on the email set up page we now have a token for [commerce-email:customer-name]

but when used I get the error above.
Is anyone using this latest copy of the module ?
Still no answer on the email issues

crooker on August 22, 2012

I would really like to know how to customize the [commerce-order:commerce-email-order-items] token so I can add some of my custom line-item fields, or even add the name of the product, SKU, etc...

Any ideas how to go about that?