Install
Works with Drupal: 7.xUsing Composer to manage Drupal site dependencies
Downloads
Download tar.gz
8.21 KB
MD5: 2a5d2cf982826e75ff6e4fe10db76670
SHA-1: 4baf70f299985beb8dc3d5547df6d4775fb36c43
SHA-256: 783e0b28c4c7bf911d14bdfe0538f8b9b4b52baa006cbfac3854df5596894c03
Download zip
9.06 KB
MD5: aebe1ab4b095acb421b8593f3f59d3be
SHA-1: 55a386fb6c9c1512f314e8552154e7b27569dcd6
SHA-256: 0db7197d8bef2e71d7d4bb674f38d611131c56587a6f0b1b13f7648894534af0
Release notes
Provides administrative UI and API for safely setting the mail_system variable.
A module "foo" with a MailSystemInterface implementation called "FooMailSystem" should add the following in its foo.install file:
/**
* Implements hook_enable().
*/
function foo_enable() {
mailsystem_set(array('foo' => 'FooMailSystem'));
}
/**
* Implements hook_disable().
*/
function foo_disable() {
mailsystem_clear(array('foo' => 'FooMailSystem'));
}
If module "foo" relies on dependency "bar" and its "BarMailSystem" class, then its code should like like this:
/**
* Implements hook_enable().
*/
function foo_enable() {
mailsystem_set(array('foo' => 'BarMailSystem'));
}
/**
* Implements hook_disable().
*/
function foo_disable() {
mailsystem_clear(array('foo' => ''));
}
If module "foo" only wants to use "BarMailSystem" when sending emails with a key of "foomail", then its code should look like this:
/**
* Implements hook_enable().
*/
function foo_enable() {
mailsystem_set(array('foo_foomail' => 'BarMailSystem'));
}
/**
* Implements hook_disable().
*/
function foo_disable() {
mailsystem_clear(array('foo_foomail' => ''));
}