Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Add an option to fix #195 : force all emails to be sent by a unique a…
…dress

(cherry picked from commit 384bb96)
  • Loading branch information
cdujeu committed Mar 17, 2014
1 parent 558fff0 commit 56930fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/plugins/core.mailer/class.AjxpMailer.php
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/core.mailer/manifest.xml
Expand Up @@ -5,6 +5,7 @@
<global_param name="UNIQUE_MAILER_INSTANCE" type="plugin_instance:mailer" label="CONF_MESSAGE[Mailer Plugin]" description="CONF_MESSAGE[Select the plugin to activate for concretely sending emails]" mandatory="true" default="mailer.phpmailer-lite"/>
<global_param name="FROM" type="string" label="CONF_MESSAGE[Sender email]" description="CONF_MESSAGE[Adress of the sender]" mandatory="true" default=""/>
<global_param name="FROM_NAME" type="string" label="CONF_MESSAGE[Sender name]" description="CONF_MESSAGE[Name of the sender]" mandatory="true" default=""/>
<global_param name="FORCE_UNIQUE_FROM" type="boolean" label="CONF_MESSAGE[Unique Sender]" description="CONF_MESSAGE[Force all mails to be sent by this Sender email, instead of users adresses]" mandatory="true" default="false"/>
<global_param name="SUBJECT_PREPEND" label="CONF_MESSAGE[Subject Prepend]" description="CONF_MESSAGE[String automatically added at the beginning of the mail subject]" type="string" mandatory="false" default=""/>
<global_param name="SUBJECT_APPEND" label="CONF_MESSAGE[Subject Append]" description="CONF_MESSAGE[String automatically added at the end of the mail subject]" type="string" mandatory="false" default=""/>
<global_param name="BODY_LAYOUT" label="CONF_MESSAGE[Body Layout]" description="CONF_MESSAGE[Main Layout for the email body, use HTML for send nice emails, and use the AJXP_MAIL_BODY keyword for the real content.]" type="textarea" mandatory="false" default="AJXP_MAIL_BODY"/>
Expand Down

0 comments on commit 56930fe

Please sign in to comment.