You are here

function webform_email_delete_form_submit in Webform 6.3

Same name and namespace in other branches
  1. 7.4 includes/webform.emails.inc \webform_email_delete_form_submit()
  2. 7.3 includes/webform.emails.inc \webform_email_delete_form_submit()

Submit handler for webform_email_delete_form().

File

includes/webform.emails.inc, line 491
Provides interface and database handling for e-mail settings of a webform.

Code

function webform_email_delete_form_submit($form, &$form_state) {

  // Delete the e-mail settings.
  $node = $form_state['values']['node'];
  $email = $form_state['values']['email'];
  webform_email_delete($node, $email);
  drupal_set_message(t('E-mail settings deleted.'));

  // Check if this webform still contains any information.
  unset($node->webform['emails'][$email['eid']]);
  webform_check_record($node);

  // Clear the entity cache if Entity Cache module is installed.
  if (module_exists('entitycache')) {
    cache_clear_all($node->nid, 'cache_entity_node');
  }
  $form_state['redirect'] = 'node/' . $node->nid . '/webform/emails';
}