Install

Works with Drupal: 7.x

Using Composer to manage Drupal site dependencies

Downloads

Download tar.gz 9.94 KB
MD5: 263cdcbe3b30c59a6ac5b5843f9a1042
SHA-1: 7997cccf5c15a0c5a06c0a44284ab6f98ad725d2
SHA-256: 91b8d487190e209a63a468ff7c686f4299103195bc3ae0bc2ca8fc8254cefda4
Download zip 12.3 KB
MD5: 50dc0eebefe4a0f5a385fcfd05d3398f
SHA-1: 8276d9d718c5d51cadd6867627b74a04485ca9cb
SHA-256: 6a1aa9195a6fcdb46d03166471eb54376b26f50ee0e9d3d398a249300cba6d97

Release notes

Changes:
Improved admin ui.
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 21:51 UTC
Last updated: 14 Apr 2011 at 21:51 UTC
Unsupported

Other releases