You are here

mail_safety.install in Mail Safety 7.2

Same filename and directory in other branches
  1. 8 mail_safety.install
  2. 7 mail_safety.install

Install, update, and uninstall functions for the Mail Safety module.

File

mail_safety.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Mail Safety module.
 */

/**
 * Implements hook_schema().
 *
 * @ingroup entity_example
 */
function mail_safety_schema() {
  $schema = array();
  $schema['mail_safety_mail'] = array(
    'description' => 'The base table for mail safety mail entity.',
    'fields' => array(
      'mid' => array(
        'description' => 'Primary key of the mail safety mail entity.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'mail_body' => array(
        'description' => 'The body of the mail being sent',
        'type' => 'text',
        'size' => 'medium',
        'not null' => FALSE,
      ),
      'mail_subject' => array(
        'description' => 'The subject of the mail being sent',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'mail_to' => array(
        'description' => 'The mail address the mail is being sent to.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'mail_cc' => array(
        'description' => 'The cc mail addresses the mail is being sent to.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'mail_module' => array(
        'description' => 'The module of the mail being sent',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'mail_key' => array(
        'description' => 'The key of the mail being sent',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'mail_serialized' => array(
        'description' => 'The serialized mail safety mail',
        'type' => 'text',
        'size' => 'big',
        'not null' => FALSE,
      ),
      'created' => array(
        'description' => 'The Unix timestamp of the time the mail entity got created.',
        'type' => 'int',
        'not null' => FALSE,
      ),
      'sent' => array(
        'description' => 'The Unix timestamp of the time the mail got sent.',
        'type' => 'int',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'mid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function mail_safety_uninstall() {
  variable_del('mail_safety_enabled');
  variable_del('mail_safety_send_mail_to_dashboard');
  variable_del('mail_safety_send_mail_to_default_mail');
  variable_del('mail_safety_default_mail_address');
}

Functions

Namesort descending Description
mail_safety_schema Implements hook_schema().
mail_safety_uninstall Implements hook_uninstall().