- Added E-Mail Header Precedence:bulk and Auto-submitted: auto-generated

to CI Mail Lib
- Sancho Mails are sent now with the new Mail Headers
This commit is contained in:
Andreas Österreicher
2018-09-25 14:41:13 +02:00
parent 445fe283fc
commit e2fd07aa84
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerIm
$body = _parseMailContent('Sancho_Mail_Template', $layout);
// Send mail
$ci->maillib->send('sancho@'. DOMAIN, $to, $subject, $body);
$ci->maillib->send('sancho@'. DOMAIN, $to, $subject, $body, $alias = '', $cc = null, $bcc = null, $altMessage = '', $bulk = true, $autogenerated = true);
}
/**
+7 -2
View File
@@ -19,7 +19,7 @@ class MailLib
* Class constructor
*/
public function __construct()
{
{
// Set the counter to 0
$this->sended = 0;
@@ -46,7 +46,7 @@ class MailLib
/**
* Sends a single email
*/
public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '')
public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '', $bulk = false, $autogenerated = false)
{
// If from is not specified then use the standard one
if (is_null($from) || $from == '')
@@ -90,6 +90,11 @@ class MailLib
$this->ci->email->message($message);
if (!isEmptyString($altMessage)) $this->ci->email->set_alt_message($altMessage);
if($bulk)
$this->ci->email->set_header('Precedence', 'bulk');
if($autogenerated)
$this->ci->email->set_header('Auto-Submitted', 'auto-generated');
// Avoid printing on standard output ugly error messages
$result = @$this->ci->email->send();