Community Documentation

Commerce Email

Last updated October 23, 2012. Created by ibot on March 7, 2012.
Edited by MrPeanut, s1l. Log in to edit this page.

Commerce Email Documentation

This is the documentation page for the Commerce Email module.

Dependencies

The 2.x version is still not completely stable, but it should work if you have:

Please make sure you have those modules in their required versions and it should work...
(derived from http://drupal.org/node/1433822#comment-5579468 )

Basic installation and usage guide

The templating process

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.
(from http://drupal.org/node/1436428#comment-5653506)

Comments

At this point if you are

At this point if you are using the latest then I think you are okay. The comment made about Variable DEV was posted on February 9th and the latest is as of January 2013 :)

Page status

About this page

Drupal version
Drupal 7.x
Audience
Programmers, Site administrators
Level
Intermediate
Keywords
Commerce, email, notifications, variables

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.