Skip to content

Commit

Permalink
Fixed issue #15808: Images in mailing not converted to CID (#1381)
Browse files Browse the repository at this point in the history
Dev: Move ResetBase part to init
Dev: reset needed (and uneeded but seem cleaner) when init
  • Loading branch information
Shnoulle committed Feb 3, 2020
1 parent 6129c13 commit 2dc7444
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions application/core/LimeMailer.php
Expand Up @@ -196,6 +196,20 @@ public function __construct($exceptions = false)
*/
public function init()
{
$this->debug = [];
$this->ContentType = self::CONTENT_TYPE_PLAINTEXT;
$this->clearCustomHeaders();
$this->clearAddresses();
$this->clearAttachments();
$this->oToken = null;
$this->Subject = "";
$this->Body = "";
$this->AltBody = "";
$this->rawSubject = "";
$this->rawBody = "";
$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'))) {
Expand All @@ -219,14 +233,10 @@ public static function getInstance($reset=self::ResetBase)
}
/* Some part must be always resetted */
if ($reset) {
self::$instance->clearAddresses(); // Unset only $this->to recepient
self::$instance->clearAttachments(); // Unset attachments (maybe only under condition ?)
self::$instance->oToken = null;
self::$instance->eventName = 'beforeEmail';
self::$instance->init();
if(self::$instance->surveyId) {
self::$instance->eventName = 'beforeSurveyEmail';
self::$instance->setSurvey(self::$instance->surveyId);
}
self::$instance->debug = [];
}

return self::$instance;
Expand Down

0 comments on commit 2dc7444

Please sign in to comment.