You are here

function reroute_email_test_email_form_submit in Reroute Email 6

Same name and namespace in other branches
  1. 7 reroute_email.admin.inc \reroute_email_test_email_form_submit()

Submit handler for email test.

File

./reroute_email.admin.inc, line 90
Reroute Email admin configuration functions.

Code

function reroute_email_test_email_form_submit(&$form, &$form_state) {
  $to = $form_state['values']['to'];
  $param_keys = array(
    'cc',
    'bcc',
    'subject',
    'body',
  );
  $params = array_intersect_key($form_state['values'], array_flip($param_keys));
  $message = drupal_mail('reroute_email', 'test_email_form', $to, language_default(), $params);
  if (!empty($message['result'])) {
    drupal_set_message(t("Test email submitted for delivery."));
  }
}