You are here

function webform_email_load in Webform 7.4

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

Load an e-mail setting from the database or initialize a new e-mail.

1 call to webform_email_load()
webform_menu_email_load in ./webform.module
Menu loader callback. Load a webform e-mail if the given eid is a valid.

File

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

Code

function webform_email_load($eid, $nid) {
  $node = node_load($nid);
  if ($eid == 'new') {
    $email = array(
      'email' => '',
      'subject' => 'default',
      'from_name' => 'default',
      'from_address' => 'default',
      'template' => 'default',
      'excluded_components' => array(),
      'exclude_empty' => 0,
      'html' => webform_variable_get('webform_default_format'),
      'attachments' => 0,
      'extra' => '',
      'status' => 1,
    );
  }
  else {
    $email = isset($node->webform['emails'][$eid]) ? $node->webform['emails'][$eid] : FALSE;
    if ($email && webform_variable_get('webform_format_override')) {
      $email['html'] = webform_variable_get('webform_default_format');
    }
  }
  return $email;
}