function mail_debugger_callback_submit_user_mail in Mail Debugger 7
Same name and namespace in other branches
- 7.2 includes/mail_debugger.callback.inc \mail_debugger_callback_submit_user_mail()
Form submit handler
_state
Parameters
array $form:
1 string reference to 'mail_debugger_callback_submit_user_mail'
- mail_debugger_callback in includes/
mail_debugger.callback.inc - Callback for drupal_get_form
File
- includes/
mail_debugger.callback.inc, line 122
Code
function mail_debugger_callback_submit_user_mail($form, &$form_state) {
// return to this page after submit
user_variable_set('mail_debugger_default_tab', 'edit-user');
// where to send the mail to?
$opts = (object) $form_state['values']['user'];
// load the user account
$account = user_load($opts->uid);
// send the mail
$result = _user_mail_notify($opts->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');
}
}