You are here

function hook_mail_safety_delete_mail in Mail Safety 7

Respond to a mail being deleted.

Parameters

int $mail_id: The mail id as it is saved in the mail safety table.

1 invocation of hook_mail_safety_delete_mail()
mail_safety_delete_mail in ./mail_safety.module
Delete a specific mail from the dashboard.

File

./mail_safety.api.php, line 52
Hooks provided by the Mail Safety module.

Code

function hook_mail_safety_delete_mail($mail_id) {
  $mail = mail_safety_load($mail_id);
  if (empty($mail)) {
    return;
  }
  if (empty($mail['mail']['attachments'])) {
    return;
  }
  foreach ($mail['mail']['attachments'] as $file) {
    file_delete($file);
  }
}