You are here

function commerce_email_mailsystem_send in Commerce Email 7

Checks the current DefaultMailSystem for MimeMail and Sends an HTML email through MimeMail or Commerce Email

Parameters

$key: The message identifier

$message: The message array

See also

http://drupal.org/project/mimemail

2 calls to commerce_email_mailsystem_send()
commerce_email_account_email_send in ./commerce_email.rules.inc
commerce_email_order_email_send in ./commerce_email.rules.inc
Rules action: Send the users order as an HTML email

File

./commerce_email.module, line 601
Defines additional menu item and order html email functonality.

Code

function commerce_email_mailsystem_send($key, $message) {
  $configuration = variable_get('mail_system', array(
    'default-system' => 'DefaultMailSystem',
  ));
  if (module_exists('mimemail')) {
    $system = drupal_mail_system('mimemail', $key);
    $message = $system
      ->format($message);
  }
  else {
    $system = drupal_mail_system('commerce_email', $key);
  }
  $system
    ->mail($message);
}