You are here

function mailsystem_mail_alter in Mail System 6.2

Same name and namespace in other branches
  1. 6 mailsystem.module \mailsystem_mail_alter()

Formats a message with the appropriate MailSystemInterface class method.

Creates an instance of the MailSystemInterface class appropriate to the $message['id'] and invokes its format() method on the message array.

This must run after all other hook_mail_alter() functions, in order to remain consistent with the 7.x version behavior.

Parameters

&$message: The message array to be altered.

See also

mailsystem_set_module_weight()

File

./mailsystem.module, line 377
Provide UI for controlling the mail_system variable.

Code

function mailsystem_mail_alter(array &$message) {
  mailsystem_parse_id($message);
  $mailsystem = drupal_mail_system($message['module'], $message['key']);
  $message = $mailsystem
    ->format($message);
}