diff options
-rw-r--r-- | core/Mail.php | 12 | ||||
-rw-r--r-- | plugins/ScheduledReports/ScheduledReports.php | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/core/Mail.php b/core/Mail.php index 09a3936a36..ee3098dd92 100644 --- a/core/Mail.php +++ b/core/Mail.php @@ -8,6 +8,7 @@ */ namespace Piwik; +use Piwik\Plugins\CoreAdminHome\CustomLogo; use Zend_Mail; /** @@ -28,6 +29,17 @@ class Mail extends Zend_Mail { parent::__construct($charset); $this->initSmtpTransport(); + $this->setDefaultFrom(); + } + + private function setDefaultFrom() + { + $customLogo = new CustomLogo(); + $fromEmailName = $customLogo->isEnabled() + ? Piwik::translate('CoreHome_WebAnalyticsReports') + : Piwik::translate('ScheduledReports_PiwikReports'); + $fromEmailAddress = Config::getInstance()->General['noreply_email_address']; + $this->setFrom($fromEmailAddress, $fromEmailName); } /** diff --git a/plugins/ScheduledReports/ScheduledReports.php b/plugins/ScheduledReports/ScheduledReports.php index cb2309b5ce..38fa35fcf7 100644 --- a/plugins/ScheduledReports/ScheduledReports.php +++ b/plugins/ScheduledReports/ScheduledReports.php @@ -274,13 +274,7 @@ class ScheduledReports extends \Piwik\Plugin $mail = new Mail(); $mail->setSubject($subject); - $customLogo = new CustomLogo(); - $fromEmailName = $customLogo->isEnabled() - ? Piwik::translate('CoreHome_WebAnalyticsReports') - : Piwik::translate('ScheduledReports_PiwikReports'); - $fromEmailAddress = Config::getInstance()->General['noreply_email_address']; $attachmentName = $subject; - $mail->setFrom($fromEmailAddress, $fromEmailName); $displaySegmentInfo = false; $segmentInfo = null; |