You are here

function wordpress_migrate_mail in WordPress Migrate 7.2

Same name and namespace in other branches
  1. 7 wordpress_migrate.module \wordpress_migrate_mail()

Implementation of hook_mail().

Parameters

$key:

$message:

$params:

File

./wordpress_migrate.module, line 45
API and drush commands to support migration of data from WordPress into a Drupal installation.

Code

function wordpress_migrate_mail($key, &$message, $params) {
  $data['user'] = $params['account'];
  $options['language'] = $message['language'];
  $variables = array();
  user_mail_tokens($variables, $data, $options);
  $variables['!output'] = $params['output'];
  $langcode = $message['language']->language;
  $subject = variable_get('wordpress_migrate_notification_subject', '');
  $message['subject'] = t($subject, $variables, array(
    'langcode' => $langcode,
  ));
  switch ($key) {
    case 'import_complete':
      $body = variable_get('wordpress_migrate_notification_body', '');
      break;
    case 'import_failure':
      $body = variable_get('wordpress_migrate_notification_failure_body', '');
      break;
  }
  $message['body'][] = t($body, $variables, array(
    'langcode' => $langcode,
  ));
}