You are here

function mandrill_mail in Mandrill 8

Same name and namespace in other branches
  1. 6 mandrill.module \mandrill_mail()
  2. 7.2 mandrill.module \mandrill_mail()
  3. 7 mandrill.module \mandrill_mail()

Implements hook_mail().

4 string references to 'mandrill_mail'
MandrillAdminSettingsForm::mailConfigurationUsesMandrillMail in src/Form/MandrillAdminSettingsForm.php
Check if a mail configuration has sender or formatter set to Mandrill.
MandrillAdminTestForm::submitForm in src/Form/MandrillAdminTestForm.php
Form submission handler.
MandrillMailerAccessCheck::access in src/Access/MandrillMailerAccessCheck.php
Access check for Mandrill module configuration.
mandrill_template_map_usage in modules/mandrill_template/mandrill_template.module
Get all mailsystem keys pointed at mandrill and their template mappings.

File

./mandrill.module, line 45
Enables Drupal to send email directly through Mandrill.

Code

function mandrill_mail($key, &$message, $params) {
  if ($key == 'test') {
    $message['subject'] = $params['subject'];
    $message['body'] = $params['body'];
    if ($params['include_attachment']) {
      $message['attachments'][] = \Drupal::service('file_system')
        ->realpath('misc/druplicon.png');
      $message['body'] .= '  ' . t('The Drupal icon is included as an attachment to test the attachment functionality.');
    }
  }
}