Hello There!

.. can someone tell me where get the commerce-order-email.tpl.php ?
it is not in the commerce_email/theme ?

Where can i change the order emails?

Thanks for any advice!

Comments

sorensong’s picture

I have the same question. Lost.

liupascal’s picture

2.x uses HtmlMail to handle the theming part, so you'll have to create a template for HtmlMail.
With Commerce Email, it seems like the workflow looks like this :
1/ Commerce Email declares a new token that contains the themed order content information,
2/ Commerce Email uses Variable Email and Rules to send the email
3/ The Mail System module is used to define the mail processor (HtmlMail) to be used for Variable Email.

So at the end : when an order is completed for instance, Rules triggers the "Send a Variable Email" action, which has the order content token, and the email text in a variable (set in admin/commerce/config/email) - Since Variable Email is set to use HtmlMail mail processor, it themes the email with the default theme provided by HtmlMail.

If you want to create a specific template for your email, you'll have to do something like this :
- Create a template email in your theme used for your email (See admin/config/system/htmlmail) with the following template name : htmlmail--variable_email--EMAIL_KEY.tpl.php where EMAIL_KEY is the variable name used (try htmlmail--variable_email--commerce_email_order.tpl.php for the default one).

For more help on the template name suggestion system of HtmlMail, go to admin/config/system/htmlmail and check "debug" checkbox, send an email and you'll see what should be your EMAIL_KEY.

Robin Millette’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

technikh’s picture

somehow my email was showing html code. I fixed it by the below code.

function my_module_name_mail_alter(&$message) {
  //watchdog('test_email', $message['id'], null, WATCHDOG_INFO, null);
  if (($message['id'] == 'variable_email_commerce_email_order') || ($message['id'] == 'variable_email_commerce_email_admin_order')) {
    $message['headers']['Content-Type'] = "text/html; charset=utf-8";
  }
}
LonitaD’s picture

It would be helpful if you put the information in #2 in a readme.txt, or at least a link to the documentation on drupal.org.