Mail Manager

Component ID

1905246

Component name

Mail Manager

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Overview

Mail Manager is first of all an API that wraps the drupal core mail functionality in an Object Oriented approach.
It aims to make custom mail functionality more intuitive and flexible by making definition of a custom mail a one step procedure rather than the more cumbersome and counter intuitive way of drupal core.

But Mail Manager also integrates with other modules like Tokens and Mail Edit allowing your content managers to easily access all defined email in an UI provided by Mail Edit and make any changes to the text of your emails using this UI and aided by the tokes integration giving you access to all the default drupal tokens as well any custom tokens you define for your emails or tokens provided by other 3rd party modules.

Features

  • Intuitive object oriented API for managing custom mails
  • One step procedure for declaring custom mails
  • Integrates with Mail Edit for easy mail text editing / translation through a UI
  • Integrates with Tokens

Requirements

Requires Mimemail, Mail Edit, Mailsystem

Documentation

Example of hook_managed_mail implementation.
Implementing this hook automatically takes care of letting drupal know about your email (no need to implement hook_mail and all the rest) and also makes the mail available in Mail Edit.

function hook_managed_mail() {
  return MailManager_ManagedMail::build('test-mail', 'This is a Test Mail')
    ->setSubject('Test subject - !now_datetime')
    ->setBody('Test Body Mail. - !now_time')
    ->addToken('now_time', date('H:i:s'), t('Now Time'))
    ->addToken('now_datetime', date('d.m.Y H:i:s Z'), t('Now DateTime'));
}