Skip to content
Snippets Groups Projects
Commit 3a11b844 authored by Peter Rotich's avatar Peter Rotich
Browse files

Send staff alerts as Notice as opposed to AutoRely

Some emails providers (e.g gmail/google) won't deliver emails marked
bulk/autoreply to group email address.
parent 7f186bd3
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ class Email {
}
function sendAlert($to, $subject, $message, $attachments=null, $options=array()) {
$options+= array('bulk' => true);
$options+= array('notice' => true);
return $this->send($to, $subject, $message, $attachments, $options);
}
......
......@@ -113,19 +113,26 @@ class Mailer {
'Return-Path' => $this->getEmail()->getEmail(),
);
//Set bulk/auto-response headers.
if($options && ($options['autoreply'] or $options['bulk'])) {
//Bulk.
if (isset($options['bulk']) && $options['bulk'])
$headers+= array('Precedence' => 'bulk');
//Auto-reply - mark as autoreply and supress all auto-replies
if (isset($options['autoreply']) && $options['autoreply']) {
$headers+= array(
'Precedence' => 'auto_reply',
'X-Autoreply' => 'yes',
'X-Auto-Response-Suppress' => 'ALL, AutoReply',
'X-Auto-Response-Suppress' => 'DR, RN, OOF, AutoReply',
'Auto-Submitted' => 'auto-replied');
if($options['bulk'])
$headers+= array('Precedence' => 'bulk');
else
$headers+= array('Precedence' => 'auto_reply');
}
//Notice (sort of automated - but we don't want auto-replies back
if (isset($options['notice']) && $options['notice'])
$headers+= array(
'X-Auto-Response-Suppress' => 'OOF, AutoReply',
'Auto-Submitted' => 'auto-generated');
if ($options) {
if (isset($options['inreplyto']) && $options['inreplyto'])
$headers += array('In-Reply-To' => $options['inreplyto']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment