You are here

function swiftmailer_mail in Swift Mailer 7

Same name and namespace in other branches
  1. 8.2 swiftmailer.module \swiftmailer_mail()
  2. 8 swiftmailer.module \swiftmailer_mail()

Implements hook_mail().

File

./swiftmailer.module, line 105
This is the primary module file.

Code

function swiftmailer_mail($key, &$message) {
  global $user;

  //$message['params']['format'] = SWIFTMAILER_FORMAT_HTML;
  $text[] = '<h3>' . t('Dear !user,', array(
    '!user' => $user->name,
  )) . '</h3>';
  $text[] = '<p>' . t('This e-mail has been sent from !site by the Swift Mailer module. The module has been successfully configured.', array(
    '!site' => variable_get('site_name', 'a Drupal site'),
  )) . '</p>';
  $text[] = t('Kind regards') . '<br /><br />';
  $text[] = t('The Swift Mailer module');
  $message['subject'] = t('Swift Mailer has been successfully configured!');
  $message['body'] = $text;
}