From 384bb96a61007b2042c0cab57ee4bd200d811ae5 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Sat, 15 Mar 2014 10:10:14 +0100 Subject: [PATCH] Add an option to fix #195 : force all emails to be sent by a unique adress --- core/src/plugins/core.mailer/class.AjxpMailer.php | 6 ++++++ core/src/plugins/core.mailer/manifest.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/core/src/plugins/core.mailer/class.AjxpMailer.php b/core/src/plugins/core.mailer/class.AjxpMailer.php index 5902439aa9..4c9cc0d0e6 100644 --- a/core/src/plugins/core.mailer/class.AjxpMailer.php +++ b/core/src/plugins/core.mailer/class.AjxpMailer.php @@ -68,6 +68,12 @@ public function sendMail($recipients, $subject, $body, $from = null, $imageLink $append = ConfService::getCoreConf("SUBJECT_APPEND", "mailer"); $layoutFolder = ConfService::getCoreConf("LAYOUT_FOLDER", "mailer"); $layout = ConfService::getCoreConf("BODY_LAYOUT", "mailer"); + $forceFrom = ConfService::getCoreConf("FORCE_UNIQUE_FROM", "mailer"); + $coreFrom = ConfService::getCoreConf("FROM", "mailer"); + if($forceFrom && $from != null){ + $coreFromName = ConfService::getCoreConf("FROM_NAME", "mailer"); + $from = array("adress" => $coreFrom, "name" => $coreFromName); + } $images = array(); if(!empty($prepend)) $subject = $prepend ." ". $subject; if(!empty($append)) $subject .= " ".$append; diff --git a/core/src/plugins/core.mailer/manifest.xml b/core/src/plugins/core.mailer/manifest.xml index fdd71c00cf..9e9745eb6f 100755 --- a/core/src/plugins/core.mailer/manifest.xml +++ b/core/src/plugins/core.mailer/manifest.xml @@ -5,6 +5,7 @@ +