Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2014-03-11 08:02:55 +0400
committermattab <matthieu.aubry@gmail.com>2014-03-11 08:02:55 +0400
commitbac1b856bbabd3f73965edd7b9909db26e847cc4 (patch)
tree9cc3458e328db63fe478265bfd734c0f13004d68 /core/Mail.php
parent301129f6e1d03ce57a215f119d7ce46963a6167a (diff)
Set default From: header in emails sent from Piwik.
This will fix the Custom Alerts missing From header.
Diffstat (limited to 'core/Mail.php')
-rw-r--r--core/Mail.php12
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);
}
/**