You are here

webform_email_reply.install in Webform Email Reply 7

Same filename and directory in other branches
  1. 8 webform_email_reply.install
  2. 7.2 webform_email_reply.install

Webform email reply module schema hook.

File

webform_email_reply.install
View source
<?php

/**
 * @file
 * Webform email reply module schema hook.
 */

/**
 * Implements hook_schema().
 */
function webform_email_reply_schema() {
  $schema = array();
  $schema['webform_email_reply'] = array(
    'description' => 'Holds information about emails sent in reply to submissions.',
    'fields' => array(
      'eid' => array(
        'description' => 'The unique identifier for the email.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'sid' => array(
        'description' => 'The unique identifier for the submission.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'The node identifier of a webform.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The id of the user that replied to the submission',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'from_address' => array(
        'description' => 'The e-mail "from" e-mail address that will be used. This may be a string, the special key "default" or a numeric value. If a numeric value is used, the value of a component will be substituted on submission.',
        'type' => 'text',
        'not null' => FALSE,
      ),
      'replied' => array(
        'description' => 'Timestamp of when the reply was sent',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'message' => array(
        'description' => 'The message text that was sent',
        'type' => 'text',
      ),
    ),
    'primary key' => array(
      'eid',
    ),
  );
  $schema['webform_email_reply_emails'] = array(
    'description' => 'Holds the default email to send a reply to in each webform.',
    'fields' => array(
      'nid' => array(
        'description' => 'The node identifier of a webform.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'cid' => array(
        'description' => 'The id of the component to use as the default email.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'from_option' => array(
        'description' => 'The type of source to use as the default from email.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}

/**
 * Add options for from emails to each webform node.
 */
function webform_email_reply_update_7001() {
  $spec = array(
    'description' => 'The e-mail "from" e-mail address that will be used. This may be a string, the special key "default" or a numeric value. If a numeric value is used, the value of a component will be substituted on submission.',
    'type' => 'text',
    'not null' => FALSE,
  );
  db_add_field('webform_email_reply', 'from_address', $spec);
  $spec = array(
    'description' => 'The type of source to use as the default from email.',
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  );
  db_add_field('webform_email_reply_emails', 'from_option', $spec);
}

Functions

Namesort descending Description
webform_email_reply_schema Implements hook_schema().
webform_email_reply_update_7001 Add options for from emails to each webform node.