You are here

function commerce_email_token_info in Commerce Email 7

Implements hook_token_info().

File

./commerce_email.tokens.inc, line 11
Defines additional tokens for order email.

Code

function commerce_email_token_info() {
  $type = array(
    'name' => t('Orders Email', array(), array(
      'context' => 'a drupal commerce order',
    )),
    'description' => t('Tokens related to individual orders.'),
    'needs-data' => 'commerce-order',
  );

  // Tokens for orders.
  $order = array();
  $order['customer-name'] = array(
    'name' => t('Name from Customer Profile'),
    'description' => t('Full name of customer'),
  );
  $order['order-items'] = array(
    'name' => t('Order Items'),
    'description' => t('A table containing order items.'),
  );
  return array(
    'types' => array(
      'commerce-email' => $type,
    ),
    'tokens' => array(
      'commerce-email' => $order,
    ),
  );
}