class MimeMailSystem in Mime Mail 7
Modify the Drupal mail system to send HTML emails.
Hierarchy
- class \MimeMailSystem implements MailSystemInterface
Expanded class hierarchy of MimeMailSystem
4 string references to 'MimeMailSystem'
- mimemail_disable in ./
mimemail.install - Implements hook_disable().
- mimemail_enable in ./
mimemail.install - Implements hook_enable().
- mimemail_example_disable in modules/
mimemail_example/ mimemail_example.install - Implements hook_disable().
- mimemail_example_enable in modules/
mimemail_example/ mimemail_example.install - Implements hook_enable().
File
- includes/
mimemail.mail.inc, line 11 - Mime Mail implementations of MailSystemInterface.
View source
class MimeMailSystem implements MailSystemInterface {
/**
* Concatenate and wrap the e-mail body for HTML mails.
*
* @param array $message
* A message array, as described in hook_mail_alter() with optional
* parameters described in mimemail_prepare_message().
*
* @return array
* The formatted $message.
*/
public function format(array $message) {
if (is_array($message['body'])) {
$message['body'] = implode("\n\n", $message['body']);
}
if (preg_match('/plain/', $message['headers']['Content-Type'])) {
$message['body'] = check_markup($message['body'], variable_get('mimemail_format', filter_fallback_format()));
}
$engine = variable_get('mimemail_engine', 'mimemail');
$engine_prepare_message = $engine . '_prepare_message';
if (function_exists($engine_prepare_message)) {
$message = $engine_prepare_message($message);
}
else {
$message = mimemail_prepare_message($message);
}
return $message;
}
/**
* Send an HTML e-mail message, using Drupal variables and default settings.
*
* @param array $message
* A message array, as described in hook_mail_alter() with optional
* parameters described in mimemail_prepare_message().
*
* @return bool
* TRUE if the mail was successfully accepted, otherwise FALSE.
*/
public function mail(array $message) {
$engine = variable_get('mimemail_engine', 'mimemail');
$mailengine = $engine . '_mailengine';
if (!$engine || !function_exists($mailengine)) {
return FALSE;
}
return $mailengine('send', $message);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MimeMailSystem:: |
public | function |
Concatenate and wrap the e-mail body for HTML mails. Overrides MailSystemInterface:: |
|
MimeMailSystem:: |
public | function |
Send an HTML e-mail message, using Drupal variables and default settings. Overrides MailSystemInterface:: |