You are here

function mail_debugger_user_form_submit in Mail Debugger 7.3

Send the system mail to a user

Parameters

type $values:

type $form_state:

1 string reference to 'mail_debugger_user_form_submit'
mail_debugger_common_mail_debugger_info in modules/common/mail_debugger_common.module
Implement hook_mail_debugger_info();

File

modules/common/includes/user.mail_debugger.inc, line 68

Code

function mail_debugger_user_form_submit($values, &$form_state) {

  // load the user account
  $account = user_load_by_mail($values['mail']);

  // send the mail
  $result = _user_mail_notify($values['type'], $account);

  // Notify about the result
  if ($result) {
    drupal_set_message(t('Message sent'));
  }
  else {
    drupal_set_message(t('Message sent with errors. Check the error log.'), 'warning');
  }
}