You are here

function backup_migrate_mail in Backup and Migrate 7.2

Same name and namespace in other branches
  1. 7.3 backup_migrate.module \backup_migrate_mail()

Implements hook_mail().

File

./backup_migrate.module, line 1085
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)

Code

function backup_migrate_mail($key, &$message, $params) {
  switch ($key) {
    case 'backup_succeed':
      $message['subject'] = t('!site backup succeeded', array(
        '!site' => variable_get('site_name', 'Drupal'),
      ));
      if ($params['messages']) {
        $message['body'][] = t("The site backup has completed successfully with the following messages:");
        $message['body'][] = t("!messages", array(
          '!messages' => $params['messages'],
        ));
      }
      else {
        $message['body'][] = t("The site backup has completed successfully.");
      }
      break;
    case 'backup_fail':
      $message['subject'] = t('!site backup failed', array(
        '!site' => variable_get('site_name', 'Drupal'),
      ));
      if ($params['messages']) {
        $message['body'][] = t("The site backup has failed with the following messages:");
        $message['body'][] = t("!messages", array(
          '!messages' => $params['messages'],
        ));
      }
      else {
        $message['body'][] = t("The site backup has failed for an unknown reason.");
      }
      break;
  }
}