Install

Works with Drupal: 7.x

Using Composer to manage Drupal site dependencies

Downloads

Download tar.gz 9.88 KB
MD5: 4a0d671a3c9050bf3f59b7eef61ca2bb
SHA-1: a1799468d0d96b4ae14ba5653f4b7e2ec45eb812
SHA-256: 486076dcf567d850d45674ead35c72dc1ef5486e0d81e5656786475c59bfa20d
Download zip 12.25 KB
MD5: ce2179e42d93b7db49dd9134f759cae4
SHA-1: 5889f3394c5189abfceb2067e91d740ea0020e40
SHA-256: e9ddc69d5697c6c3eb0c982784a9d8c7ce5658e1db4c7e8c33601142557d5fd4

Release notes

Changes:
More UI improvements.
Mail System

Provides an Administrative UI and Developers API for safely updating the mail_system configuration variable.

Administrative UI

The administrative interface is at admin/config/system/mailsystem. A screenshot is available.

Used by;

Developers API

A module example with a MailSystemInterface implementation called ExampleMailSystem should add the following in its example.install file:

/**
 * Implements hook_enable().
 */
function example_enable() {
  mailsystem_set(array('example' => 'ExampleMailSystem'));
}
/**
 * Implements hook_disable().
 */
function example_disable() {
  mailsystem_clear(array('example' => 'ExampleMailSystem'));
}

The above settings allow mail sent by example to use ExampleMailSystem. To make ExampleMailSystem the site-wide default for sending mail:

mailsystem_set(array(mailsystem_default_id() => 'ExampleMailSystem'));

To restore the default mail system:

mailsystem_set(array(mailsystem_default_id() => mailsystem_default_value()));

Or simply:

mailsystem_set(mailsystem_defaults());

If module example relies on dependency foo and its FooMailSystem class, then the example.install code should like like this:

/**
 * Implements hook_enable().
 */
function example_enable() {
  mailsystem_set(array('example' => 'FooMailSystem'));
}
/**
 * Implements hook_disable().
 */
function example_disable() {
  mailsystem_clear(array('example' => ''));
}

If module example only wants to use FooMailSystem when sending emails with a key of examail, then the example.install code should look like this:

/**
 * Implements hook_enable().
 */
function example_enable() {
  mailsystem_set(array('example_examail' => 'FooMailSystem'));
}
/**
 * Implements hook_disable().
 */
function example_disable() {
  mailsystem_clear(array('example_examail' => ''));
}

References

drupal_mail_system() API documentation:

http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail...

MailSystemInterface API documentation:

http://api.drupal.org/api/drupal/includes--mail.inc/interface/MailSystem...

Creating HTML formatted mails in Drupal 7

http://drupal.org/node/900794

Created by: pillarsdotnet
Created on: 14 Apr 2011 at 22:46 UTC
Last updated: 14 Apr 2011 at 22:46 UTC
Unsupported

Other releases