diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-03-11 08:02:55 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-03-11 08:02:55 +0400 |
commit | bac1b856bbabd3f73965edd7b9909db26e847cc4 (patch) | |
tree | 9cc3458e328db63fe478265bfd734c0f13004d68 /core | |
parent | 301129f6e1d03ce57a215f119d7ce46963a6167a (diff) |
Set default From: header in emails sent from Piwik.
This will fix the Custom Alerts missing From header.
Diffstat (limited to 'core')
-rw-r--r-- | core/Mail.php | 12 |
1 files changed, 12 insertions, 0 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); } /** |