You are here

function webform_email_insert in Webform 6.3

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

Insert a new e-mail setting into the database.

Parameters

$email: An array of settings for sending an e-mail.

3 calls to webform_email_insert()
webform_email_edit_form_submit in includes/webform.emails.inc
Submit handler for webform_email_edit_form().
webform_node_insert in ./webform.module
Implements hook_node_insert().
webform_node_update in ./webform.module
Implements hook_node_update().

File

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

Code

function webform_email_insert($email) {
  db_lock_table('webform_emails');
  $email['eid'] = isset($email['eid']) ? $email['eid'] : db_result(db_query('SELECT MAX(eid) FROM {webform_emails} WHERE nid = %d', $email['nid'])) + 1;
  $email['excluded_components'] = implode(',', $email['excluded_components']);
  drupal_write_record('webform_emails', $email);
  db_unlock_tables();
  return $email['eid'];
}