Skip to content

Commit

Permalink
Fixed issue #16072: E-Mail Sender Name is always "Administrator"
Browse files Browse the repository at this point in the history
Dev: move default from and sender from init to constructor
Dev: move eventName too
  • Loading branch information
Shnoulle committed Apr 2, 2020
1 parent 7616f36 commit 6edf45a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions application/core/LimeMailer.php
Expand Up @@ -189,6 +189,12 @@ public function __construct($exceptions = false)
$this->IsMail();
}
$this->init();
/* set default from return path and event , didn't reset when getInstance */
$this->setFrom(Yii::app()->getConfig('siteadminemail'),Yii::app()->getConfig('siteadminname'));
if(!empty(Yii::app()->getConfig('siteadminbounce'))) {
$this->Sender = Yii::app()->getConfig('siteadminbounce');
}
$this->eventName = 'beforeEmail';
}

/**
Expand All @@ -210,12 +216,6 @@ public function init()
$this->AltBody = "";
$this->MIMEBody = "";
$this->MIMEHeader = "";
$this->setFrom(Yii::app()->getConfig('siteadminemail'),Yii::app()->getConfig('siteadminname'));
/* set default return path */
if(!empty(Yii::app()->getConfig('siteadminbounce'))) {
$this->Sender = Yii::app()->getConfig('siteadminbounce');
}
$this->eventName = 'beforeEmail';
$this->addCustomHeader("X-Surveymailer",Yii::app()->getConfig("sitename")." Emailer (LimeSurvey.org)");
}

Expand All @@ -238,7 +238,6 @@ public static function getInstance($reset=self::ResetBase)
self::$instance->setSurvey(self::$instance->surveyId);
}
}

return self::$instance;
}

Expand Down

0 comments on commit 6edf45a

Please sign in to comment.