Skip to content
Snippets Groups Projects
Commit ae844f0d authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge pull request #510 from protich/feature/staff-alert


Send staff alerts as Notice as opposed to an AutoRely

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 7f186bd3 3a11b844
No related branches found
No related tags found
No related merge requests found
...@@ -160,7 +160,7 @@ class Email { ...@@ -160,7 +160,7 @@ class Email {
} }
function sendAlert($to, $subject, $message, $attachments=null, $options=array()) { 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); return $this->send($to, $subject, $message, $attachments, $options);
} }
......
...@@ -113,19 +113,26 @@ class Mailer { ...@@ -113,19 +113,26 @@ class Mailer {
'Return-Path' => $this->getEmail()->getEmail(), '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( $headers+= array(
'Precedence' => 'auto_reply',
'X-Autoreply' => 'yes', 'X-Autoreply' => 'yes',
'X-Auto-Response-Suppress' => 'ALL, AutoReply', 'X-Auto-Response-Suppress' => 'DR, RN, OOF, AutoReply',
'Auto-Submitted' => 'auto-replied'); '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 ($options) {
if (isset($options['inreplyto']) && $options['inreplyto']) if (isset($options['inreplyto']) && $options['inreplyto'])
$headers += array('In-Reply-To' => $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.
Please register or to comment