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:
Diffstat (limited to 'core/Mail.php')
-rw-r--r--core/Mail.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Mail.php b/core/Mail.php
index 8146db3218..6c9d323ce5 100644
--- a/core/Mail.php
+++ b/core/Mail.php
@@ -33,6 +33,14 @@ class Piwik_Mail extends Zend_Mail
{
$hostname = Zend_Registry::get('config')->mail->defaultHostnameIfEmpty;
$piwikHost = Piwik_Url::getCurrentHost($hostname);
+
+ // If known Piwik URL, use it instead of "localhost"
+ $piwikUrl = Piwik::getPiwikUrl();
+ $url = parse_url($piwikUrl);
+ if(isset($url['host']))
+ {
+ $piwikHost = $url['host'];
+ }
$email = str_replace('{DOMAIN}', $piwikHost, $email);
parent::setFrom($email, $name);
}