You are here

function mail_safety_admin_delete_form_submit in Mail Safety 7

Same name and namespace in other branches
  1. 7.2 mail_safety.admin.inc \mail_safety_admin_delete_form_submit()

Form submission handler for mail_safety_admin_delete_form_submit.

Delete a mail from the dashboard.

1 string reference to 'mail_safety_admin_delete_form_submit'
mail_safety_admin_delete_form in ./mail_safety.admin.inc
Form constructor to delete a mail from the dashboard.

File

./mail_safety.admin.inc, line 342
Admin functionality for Mail Safety

Code

function mail_safety_admin_delete_form_submit(&$form, &$form_state) {
  if (!empty($form_state['values']['mail_id']) && mail_safety_delete_mail($form_state['values']['mail_id'])) {
    drupal_set_message(t('Succesfully deleted the mail'));
  }
  else {
    drupal_set_message(t('Could not delete the mail'), 'error');
  }
  $form_state['redirect'] = 'admin/config/development/mail_safety';
}