diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-09-21 01:53:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-21 01:53:37 +0300 |
commit | 2d2abcc9576079a8496ad8bd4a038ba07cf1fb2b (patch) | |
tree | 511d4c06b004d8162fb3cd2480252c25caa13a63 /plugins/CoreHome/templates | |
parent | a7f5d6478cfcff4cb2b9a19b40f2b526da8f1eea (diff) |
Send email if no tracked data within N days. (#13363)
* Remember user who created a site.
* Send email if no tracked data within N days.
* Add test and get to pass.
* Fixes after manual tests of emails
* Bump version & change column name to creator_login.
* Email tweaks.
* Rename Site::getCreationUserFor
* Modify Site:: access methiod name
* Applying PR feedback.
* Move email HTML content generation logic to separate class in DI.
* tweak translations
* Apply PR review feedback.
* Couple more tweaks.
* Make tracking code check a one time task + and save timetable when removing inactive tasks.
* Update save call.
* Apply more PR feedback.
* small performance tweak and put the site name in quotes
* Fixing tests.
* Update expected file.
Diffstat (limited to 'plugins/CoreHome/templates')
4 files changed, 54 insertions, 51 deletions
diff --git a/plugins/CoreHome/templates/ReportRenderer/_htmlReportFooter.twig b/plugins/CoreHome/templates/ReportRenderer/_htmlReportFooter.twig index 4de5aae199..754fd1f355 100644 --- a/plugins/CoreHome/templates/ReportRenderer/_htmlReportFooter.twig +++ b/plugins/CoreHome/templates/ReportRenderer/_htmlReportFooter.twig @@ -1,17 +1 @@ -{% set fontStyle = 'color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Helvetica Neue", sans-serif; '%} -{% set styleParagraph = 'font-size:15px;line-height:24px;margin:0 0 16px;' %} - -{% if not hasWhiteLabel %} - <hr style=" border: 0; margin-top: 50px; height: 1px; background-image: linear-gradient(to right, rgba(231, 231, 231, 0), rgba(231, 231, 231, 1), rgba(2311, 2311, 231, 0));"> - - <p style='{{styleParagraph}}{{fontStyle}}text-align:center;font-size:13px; color:#666; padding:30px'> - {{'General_PoweredBy'|translate}} - <a style="color:#439fe0; " href="https://matomo.org/" title="Matomo Analytics">Matomo Analytics</a> - <br /> - {{ 'CoreHome_LeadingAnalyticsPlatformRespectsYourPrivacy'|translate }} - </p> -{% endif %} - -</div> -</body> -</html> +{% include "@CoreHome/_htmlEmailFooter.twig" %}
\ No newline at end of file diff --git a/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig b/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig index 45247efa2d..c6b2fdf98f 100644 --- a/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig +++ b/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig @@ -1,38 +1,5 @@ -{% set fontStyle %}color:{{ themeStyles.colorText }};font-family:{{ themeStyles.fontFamilyBase }};{% endset %} -{% set styleParagraph = 'font-size:15px;line-height:24px;margin:0 0 16px;' %} +{% include "@CoreHome/_htmlEmailHeader.twig" %} -<html style="background-color:#edecec"> - -<head> - <meta charset="utf-8"> - <meta name="robots" content="noindex,nofollow"> - <meta name="generator" content="Matomo Analytics"> -</head> - -<body style="{{fontStyle}} line-height: 24px; margin:0 auto; max-width:1000px; background-color:rgb(255, 255, 255);box-shadow: 0px 0px 5px 1px rgba(0,0,0,0.75);"> - - <a name="reportTop"></a> - - <table style="width:100%; background-color: {{ themeStyles.colorHeaderBackground }}; color: {{ themeStyles.colorHeaderText }}; padding:10px 0; margin: 0 0 25px 0; height:64px;"> - <tr> - <td> - <a style="{{ fontStyle }}; font-size:16px;padding:0 15px;color: {{ themeStyles.colorHeaderText }};height: 22px;display: inline-block;vertical-align: inherit;" rel="noreferrer noopener" target="_blank" href="{{ piwikUrl }}" style="lineheight:17px"> - {% if isCustomLogo and logoHeader %} - <img src="{{ logoHeader }}" height="20px" width="auto" /> - {% else %} - <img src="{{ piwikUrl }}/plugins/Morpheus/images/logo-email.png" height="20px" width="auto" alt="{{ emailStyles.brandNameLong }}" /> - {% endif %} - </a> - </td> - <td align="right"> - <a style="{{ fontStyle }}; font-size:16px; padding:0 15px; color: {{ themeStyles.colorHeaderText }}" title="{{'Dashboard_TopLinkTooltip'|translate(websiteName)}}" target="_blank" href="{{ piwikUrl }}{{ linkTo({'module': 'CoreHome', 'action': 'index', 'idSite': idSite, 'period': period, 'date': date, 'token_auth': null, 'method': null, 'idReport': null, 'outputType': null, 'format': null})|raw }}"> - {{ 'Dashboard_Dashboard'|translate }} - </a> - </td> - </tr> - </table> - - <div style="margin:0 20px;"> <h2 style='{{fontStyle}} color:#37474f; line-height:30px; margin:25px 0 15px 0;'> {{'ScheduledReports_EmailHello'|translate}} </h2> diff --git a/plugins/CoreHome/templates/_htmlEmailFooter.twig b/plugins/CoreHome/templates/_htmlEmailFooter.twig new file mode 100644 index 0000000000..6117beebf8 --- /dev/null +++ b/plugins/CoreHome/templates/_htmlEmailFooter.twig @@ -0,0 +1,16 @@ +{% set fontStyle %}color:{{ themeStyles.colorText|e('html_attr') }};font-family:{{ themeStyles.fontFamilyBase|e('html_attr') }};{% endset %} + +{% if not hasWhiteLabel %} + <hr style=" border: 0; margin-top: 50px; height: 1px; background-image: linear-gradient(to right, rgba(231, 231, 231, 0), rgba(231, 231, 231, 1), rgba(2311, 2311, 231, 0));"> + + <p style='{{styleParagraph|raw}}{{fontStyle|raw}}text-align:center;font-size:13px; color:#666; padding:30px'> + {{'General_PoweredBy'|translate}} + <a style="color:#439fe0; " href="https://matomo.org/" title="Matomo Analytics">Matomo Analytics</a> + <br /> + {{ 'CoreHome_LeadingAnalyticsPlatformRespectsYourPrivacy'|translate }} + </p> +{% endif %} + +</div> +</body> +</html> diff --git a/plugins/CoreHome/templates/_htmlEmailHeader.twig b/plugins/CoreHome/templates/_htmlEmailHeader.twig new file mode 100644 index 0000000000..30d0eedbab --- /dev/null +++ b/plugins/CoreHome/templates/_htmlEmailHeader.twig @@ -0,0 +1,36 @@ +{% set fontStyle %}color:{{ themeStyles.colorText|e('html_attr') }};font-family:{{ themeStyles.fontFamilyBase|e('html_attr') }};{% endset %} + +<html style="background-color:#edecec"> + +<head> + <meta charset="utf-8"> + <meta name="robots" content="noindex,nofollow"> + <meta name="generator" content="Matomo Analytics"> +</head> + +<body style="{{fontStyle|raw}} line-height: 24px; margin:0 auto; max-width:1000px; background-color:rgb(255, 255, 255);box-shadow: 0px 0px 5px 1px rgba(0,0,0,0.75);"> + +<a name="reportTop"></a> + +<table style="width:100%; background-color: {{ themeStyles.colorHeaderBackground|e('html_attr') }}; color: {{ themeStyles.colorHeaderText|e('html_attr') }}; padding:10px 0; margin: 0 0 25px 0; height:64px;"> + <tr> + <td> + <a style="{{ fontStyle|raw }}; font-size:16px;padding:0 15px;color: {{ themeStyles.colorHeaderText|e('html_attr') }};height: 22px;display: inline-block;vertical-align: inherit;" rel="noreferrer noopener" target="_blank" href="{{ piwikUrl }}" style="lineheight:17px"> + {% if isCustomLogo and logoHeader %} + <img src="{{ logoHeader }}" height="20px" width="auto" /> + {% else %} + <img src="{{ piwikUrl }}/plugins/Morpheus/images/logo-email.png" height="20px" width="auto" alt="{{ emailStyles.brandNameLong|e('html_attr') }}" /> + {% endif %} + </a> + </td> + <td align="right"> + {% if idSite|default is not empty %} + <a style="{{ fontStyle|raw }}; font-size:16px; padding:0 15px; color: {{ themeStyles.colorHeaderText|e('html_attr') }}" {% if websiteName|default is not empty %}title="{{'Dashboard_TopLinkTooltip'|translate(websiteName)}}"{% endif %} target="_blank" href="{{ piwikUrl }}{{ linkTo({'module': 'CoreHome', 'action': 'index', 'idSite': idSite, 'period': period, 'date': date, 'token_auth': null, 'method': null, 'idReport': null, 'outputType': null, 'format': null})|raw }}"> + {{ 'Dashboard_Dashboard'|translate }} + </a> + {% endif %} + </td> + </tr> +</table> + +<div style="margin:0 20px;"> |