function maestro_mail in Maestro 8.2
Same name and namespace in other branches
- 3.x maestro.module \maestro_mail()
Implements hook_mail().
File
- ./
maestro.module, line 402 - Provides glue logic, hook implementation and core set process variable functions.
Code
function maestro_mail($key, &$message, $params) {
$options = [
'langcode' => $message['langcode'],
];
// Dev note:
// use hook_mail_alter to set a different subject line.
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
switch ($key) {
case 'assignment_notification':
$message['from'] = \Drupal::config('system.site')
->get('mail');
$subject = Html::escape($params['subject']);
$message['subject'] = isset($subject) ? $subject : t('You have a new task assignment');
$message['body'][] = $params['message'];
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
break;
case 'reminder_notification':
$message['from'] = \Drupal::config('system.site')
->get('mail');
$subject = HTML::escape($params['subject']);
$message['subject'] = isset($subject) ? $subject : t('A reminder that you have outstanding tasks');
$message['body'][] = $params['message'];
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
break;
case 'escalation_notification':
$message['from'] = \Drupal::config('system.site')
->get('mail');
$subject = HTML::escape($params['subject']);
$message['subject'] = isset($subject) ? $subject : t('A task has been escalated to you');
$message['body'][] = $params['message'];
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
break;
}
}