You are here

function webform_reply_to_form_submit in Webform Reply To 6

Same name and namespace in other branches
  1. 7.2 webform_reply_to.module \webform_reply_to_form_submit()
  2. 7 webform_reply_to.module \webform_reply_to_form_submit()
1 string reference to 'webform_reply_to_form_submit'
webform_reply_to_form_alter in ./webform_reply_to.module
Implementation of hook_form_alter().

File

./webform_reply_to.module, line 54

Code

function webform_reply_to_form_submit($form, &$form_state) {
  $email = array(
    'eid' => $form_state['values']['eid'],
    'nid' => $form_state['values']['node']->nid,
  );
  $field = 'reply_to';
  $option = $form_state['values'][$field . '_option'];
  if ($option == 'default') {
    $email[$field] = 'default';
  }
  else {
    $email[$field] = $form_state['values'][$field . '_' . $option];
  }

  // We should be using webform_email_update($email), but it returns an error due to
  // the NULL $email['excluded_components'], so we use drupal_write_record instead
  drupal_write_record('webform_emails', $email, array(
    'nid',
    'eid',
  ));
}