You are here

function mail_safety_insert_mail in Mail Safety 7

Same name and namespace in other branches
  1. 7.2 mail_safety.module \mail_safety_insert_mail()

Saves the mail to the dashboard.

Parameters

array $message: The drupal message array.

1 call to mail_safety_insert_mail()
mail_safety_mail_alter in ./mail_safety.module
Implements hook_mail_alter().

File

./mail_safety.module, line 208
The core Mail Safety module file

Code

function mail_safety_insert_mail($message) {

  // Let other modules alter the message array before a mail is inserted.
  // E.g. save attachments that are sent with the mail.
  drupal_alter('mail_safety_pre_insert', $message);
  $mail = array(
    'sent' => time(),
    'mail' => serialize($message),
  );
  db_insert('mail_safety_dashboard')
    ->fields($mail)
    ->execute();
}