devel_mail_logger_civicrm.module in Devel Mail Logger 7
File
devel_mail_logger_civicrm/devel_mail_logger_civicrm.module
View source
<?php
function devel_mail_logger_civicrm_civicrm_alterMailParams(&$params, $context) {
if ($context == 'singleEmail') {
$drupal_mail_params = array(
'subject' => $params['subject'],
'body' => array(
isset($params['html']) ? $params['html'] : $params['text'],
),
);
if (isset($params['bcc'])) {
$drupal_mail_params['bcc'] = $params['bcc'];
}
if (isset($params['headers'])) {
$drupal_mail_params['headers'] = $params['headers'];
}
drupal_mail('devel_mail_logger_civicrm', 'devel_mail_logger_civicrm_email', $params['toEmail'], LANGUAGE_NONE, $drupal_mail_params, $params['from']);
$params['abortMailSend'] = TRUE;
}
}
function devel_mail_logger_civicrm_mail($key, &$message, $params) {
switch ($key) {
case 'devel_mail_logger_civicrm_email':
$message['subject'] = $params['subject'];
$message['body'] = $params['body'];
break;
}
}