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:
authordiosmosis <diosmosis@users.noreply.github.com>2019-01-04 09:34:37 +0300
committerGitHub <noreply@github.com>2019-01-04 09:34:37 +0300
commite92247972a99092eb300bcbc163492542017d1b5 (patch)
tree96396004aab1e2e7010c31388707a99b66d78a90 /plugins/CoreUpdater
parent8e499448926af8870aa6f011128ba4031e4cfcb8 (diff)
Make sure all Matomo emails use correct branding. (#13908)
* Make sure all Matomo emails use correct branding. * update email logo * reuse variables * Change default from to Matomo Analytics. * Fix list style in report emails, update customalerts submodule and make dashboard link got to default erport in emails. * Updated submodule. * Bump version + update submodules. * Remove submodule update so plugins can be merged after rc2 merged.
Diffstat (limited to 'plugins/CoreUpdater')
-rw-r--r--plugins/CoreUpdater/UpdateCommunication.php31
-rw-r--r--plugins/CoreUpdater/templates/_updateCommunicationEmail.twig18
2 files changed, 27 insertions, 22 deletions
diff --git a/plugins/CoreUpdater/UpdateCommunication.php b/plugins/CoreUpdater/UpdateCommunication.php
index 69f98c528f..82dfca54fd 100644
--- a/plugins/CoreUpdater/UpdateCommunication.php
+++ b/plugins/CoreUpdater/UpdateCommunication.php
@@ -16,6 +16,7 @@ use Piwik\Plugins\UsersManager\API as UsersManagerApi;
use Piwik\SettingsPiwik;
use Piwik\UpdateCheck;
use Piwik\Version;
+use Piwik\View;
/**
* Class to check and notify users via email if there is a core update available.
@@ -66,30 +67,16 @@ class UpdateCommunication
$host = SettingsPiwik::getPiwikUrl();
$subject = Piwik::translate('CoreUpdater_NotificationSubjectAvailableCoreUpdate', $latestVersion);
- $message = Piwik::translate('ScheduledReports_EmailHello');
- $message .= "\n\n";
- $message .= Piwik::translate('CoreUpdater_ThereIsNewVersionAvailableForUpdate');
- $message .= "\n\n";
- $message .= Piwik::translate('CoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage', $latestVersion);
- $message .= "\n";
- $message .= $host . 'index.php?module=CoreUpdater&action=newVersionAvailable';
- $message .= "\n\n";
- $version = new Version();
- if ($version->isStableVersion($latestVersion)) {
- $message .= Piwik::translate('CoreUpdater_ViewVersionChangelog');
- $message .= "\n";
- $message .= $this->getLinkToChangeLog($latestVersion);
- $message .= "\n\n";
- }
+ $view = new View('@CoreUpdater/_updateCommunicationEmail.twig');
+ $view->latestVersion = $latestVersion;
+ $view->host = $host;
- $message .= Piwik::translate('CoreUpdater_ReceiveEmailBecauseIsSuperUser', $host);
- $message .= "\n\n";
- $message .= Piwik::translate('CoreUpdater_FeedbackRequest');
- $message .= "\n";
- $message .= 'https://matomo.org/contact/';
+ $version = new Version();
+ $view->isStableVersion = $version->isStableVersion($latestVersion);
+ $view->linkToChangeLog = $this->getLinkToChangeLog($latestVersion);
- $this->sendEmailNotification($subject, $message);
+ $this->sendEmailNotification($subject, $view);
}
private function getLinkToChangeLog($version)
@@ -116,7 +103,7 @@ class UpdateCommunication
$mail->setDefaultFromPiwik();
$mail->addTo($superUser['email']);
$mail->setSubject($subject);
- $mail->setBodyText($message);
+ $mail->setWrappedHtmlBody($message);
$mail->send();
}
}
diff --git a/plugins/CoreUpdater/templates/_updateCommunicationEmail.twig b/plugins/CoreUpdater/templates/_updateCommunicationEmail.twig
new file mode 100644
index 0000000000..b388fe7d20
--- /dev/null
+++ b/plugins/CoreUpdater/templates/_updateCommunicationEmail.twig
@@ -0,0 +1,18 @@
+<p>{{ 'ScheduledReports_EmailHello'|translate }}</p>
+
+<p>{{ 'CoreUpdater_ThereIsNewVersionAvailableForUpdate'|translate }}</p>
+
+<p>{{ 'CoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage'|translate(latestVersion) }}<br/>
+{{ host }}index.php?module=CoreUpdater&action=newVersionAvailable
+</p>
+
+{% if isStableVersion %}
+<p>
+ {{ 'CoreUpdater_ViewVersionChangelog'|translate }}
+ <br/>
+ {{ linkToChangeLog }}
+</p>
+{% endif %}
+
+<p>{{ 'CoreUpdater_ReceiveEmailBecauseIsSuperUser'|translate(host) }}</p>
+<p>{{ 'CoreUpdater_FeedbackRequest'|translate }}<br/>https://matomo.org/contact/</p>