N°1319 & N°1203: Added a conf params 'email_default_sender_address' and 'email_default_sender_label' that will be used if a mail has no sender set. (forgot password, test mail, test notification mail, data source fail notification)

SVN:trunk[5750]
This commit is contained in:
Stephen Abello
2018-04-27 08:29:48 +00:00
parent 2be0250aee
commit d441595ee6
6 changed files with 25 additions and 12 deletions

View File

@@ -260,6 +260,14 @@ class EMail
public function Send(&$aIssues, $bForceSynchronous = false, $oLog = null)
{
//select a default sender if none is provided.
if(empty($this->m_aData['from']['address']))
{
$this->SetRecipientFrom(MetaModel::GetConfig()->Get('email_default_sender_address'), MetaModel::GetConfig()->Get('email_default_sender_label'));
if(empty($this->m_aData['from']['address']) && !empty($this->m_aData['to'])){
$this->SetRecipientFrom($this->m_aData['to']);
}
}
if ($bForceSynchronous)
{
return $this->SendSynchronous($aIssues, $oLog);