Pluggable Mailers

Categories

Component ID

1743362

Component name

Pluggable Mailers

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

666

Component created

Component changed

Component body

Pluggable Mailers makes it easier for developers to write new email services for Drupal, by providing an object-oriented wrapper around Drupal's hook_mail() implementation. A default mailer is included.

Pluggable mailers can also be used as a wrapper around the default Drupal mail functionality, allowing you to send an email with just one function (no hook_mail()) required.

Adding your own email plugins

Making a new pluggable mailer is easy, just create a new Ctools plugin of type "pluggable_mailer", and implement the PluggableMailInterface. There is an assumption that you will extend the base PluggableMailPlugin class as well, to get access to readily defined methods for common tasks, though this is not necessary if you are able to implement all the methods yourself, such that they return acceptable values.

API

DrupalPluggableMailersPluggableMailInterface
Defines base functionality for a mail class, including setting of parameters, choice of mail system, and preparing template variables.

DrupalPluggableMailersPluggableMailPlugin
Defines some default implementations of the PluggableMailInterface.

pluggable_mailers_send_email($email_address, $params = array(), $plugin_name = 'default', $from_address = NULL, $language = NULL)
Send an email to an email address.

This module was developed with the support of PreviousNext.