From 9287d926f768d8b4576fc77c23495fd8551d5f90 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 22 Jul 2017 22:23:22 +1000 Subject: [PATCH] Refit invite and restore mail templates Fixes {% partial %} node for mail templates Trim body var for text emails Style code nodes --- modules/backend/views/mail/invite.htm | 34 +++++-------------- modules/backend/views/mail/restore.htm | 17 +++------- .../models/mailbrandsetting/custom.less | 6 ++++ modules/system/twig/MailPartialNode.php | 2 +- modules/system/views/mail/partial-button.htm | 2 +- modules/system/views/mail/partial-footer.htm | 2 +- modules/system/views/mail/partial-header.htm | 2 +- modules/system/views/mail/partial-panel.htm | 2 +- .../system/views/mail/partial-promotion.htm | 2 +- modules/system/views/mail/partial-subcopy.htm | 2 +- modules/system/views/mail/partial-table.htm | 2 +- 11 files changed, 27 insertions(+), 46 deletions(-) diff --git a/modules/backend/views/mail/invite.htm b/modules/backend/views/mail/invite.htm index 5abbe1403..6554b9167 100644 --- a/modules/backend/views/mail/invite.htm +++ b/modules/backend/views/mail/invite.htm @@ -2,35 +2,19 @@ subject = "Welcome to October CMS" layout = "system" description = "Invite new admin to the site" == - -Hi {{ name }}, +Hi {{ name }} A user account has been created for you. -Login: {{ login }} - -Password: {{ password }} - - -After signing in you should change your password by clicking your name on the top right corner of the administration area. +{% component 'panel' %} +- Login: `admin4{{ login }}` +- Password: `admin{{ password }}` +{% endcomponent %} You can use the following link to sign in: -{{ link }} -== +{% component 'button' url=link %} + Sign in to admin area +{% endcomponent %} -

Hi {{ name }},

- -

A user account has been created for you.

- -

- Login: {{ login }}
- Password: {{ password }} -

- -

After signing in you should change your password by clicking your name on the top right corner of the administration area.

- -

- You can use the following link to sign in:
- {{ link }} -

+After signing in you should change your password by clicking your name on the top right corner of the administration area. diff --git a/modules/backend/views/mail/restore.htm b/modules/backend/views/mail/restore.htm index b0719c725..916d98617 100644 --- a/modules/backend/views/mail/restore.htm +++ b/modules/backend/views/mail/restore.htm @@ -2,21 +2,12 @@ subject = "Password Reset" layout = "system" description = "Reset an admin password" == - -Hello {{ name }}, +Hello {{ name }} Somebody has requested a password reset for your account, if this was not you, please ignore this email. You can use the following link to restore your password: -{{ link }} -== - -

Hello {{ name }},

- -

Somebody has requested a password reset for your account, if this was not you, please ignore this email.

- -

- You can use the following link to restore your password:
- {{ link }} -

+{% component 'button' url=link type='positive' %} +Restore password +{% endcomponent %} diff --git a/modules/system/models/mailbrandsetting/custom.less b/modules/system/models/mailbrandsetting/custom.less index ea5617297..05cbe094c 100644 --- a/modules/system/models/mailbrandsetting/custom.less +++ b/modules/system/models/mailbrandsetting/custom.less @@ -71,6 +71,12 @@ p { text-align: left; } +code { + color: @text-color; + font-size: 16px; + line-height: 1.5em; +} + p.sub { font-size: 12px; } diff --git a/modules/system/twig/MailPartialNode.php b/modules/system/twig/MailPartialNode.php index 8b95e3f63..163329e70 100644 --- a/modules/system/twig/MailPartialNode.php +++ b/modules/system/twig/MailPartialNode.php @@ -34,7 +34,7 @@ class MailPartialNode extends Twig_Node } $compiler - ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->partialFunction(") + ->write("echo \System\Classes\MailManager::instance()->renderPartial(") ->subcompile($this->getNode('nodes')->getNode(0)) ->write(", \$context['__system_partial_params']") ->write(");\n") diff --git a/modules/system/views/mail/partial-button.htm b/modules/system/views/mail/partial-button.htm index 46aab658c..2abba70e0 100644 --- a/modules/system/views/mail/partial-button.htm +++ b/modules/system/views/mail/partial-button.htm @@ -1,6 +1,6 @@ name = "Button" == -{{ body }} <{{ url }}> +{{ body|trim }} <{{ url }}> == diff --git a/modules/system/views/mail/partial-footer.htm b/modules/system/views/mail/partial-footer.htm index 5e5150fe5..c9c74a81b 100644 --- a/modules/system/views/mail/partial-footer.htm +++ b/modules/system/views/mail/partial-footer.htm @@ -1,7 +1,7 @@ name = "Footer" == ------------------- -{{ body }} +{{ body|trim }} ==
diff --git a/modules/system/views/mail/partial-header.htm b/modules/system/views/mail/partial-header.htm index f0a845029..7471616c4 100644 --- a/modules/system/views/mail/partial-header.htm +++ b/modules/system/views/mail/partial-header.htm @@ -1,6 +1,6 @@ name = "Header" == -*** {{ body }} <{{ url }}> +*** {{ body|trim }} <{{ url }}> ==
diff --git a/modules/system/views/mail/partial-panel.htm b/modules/system/views/mail/partial-panel.htm index 12f24e3ec..fa6ef4a9f 100644 --- a/modules/system/views/mail/partial-panel.htm +++ b/modules/system/views/mail/partial-panel.htm @@ -1,6 +1,6 @@ name = "Panel" == -{{ body }} +{{ body|trim }} == diff --git a/modules/system/views/mail/partial-promotion.htm b/modules/system/views/mail/partial-promotion.htm index 6302f7b92..fe9e877fc 100644 --- a/modules/system/views/mail/partial-promotion.htm +++ b/modules/system/views/mail/partial-promotion.htm @@ -1,6 +1,6 @@ name = "Promotion" == -{{ body }} +{{ body|trim }} ==
diff --git a/modules/system/views/mail/partial-subcopy.htm b/modules/system/views/mail/partial-subcopy.htm index 4e2c9fc77..ffebb5ef4 100644 --- a/modules/system/views/mail/partial-subcopy.htm +++ b/modules/system/views/mail/partial-subcopy.htm @@ -1,6 +1,6 @@ name = "Subcopy" == -{{ body }} +{{ body|trim }} ==
diff --git a/modules/system/views/mail/partial-table.htm b/modules/system/views/mail/partial-table.htm index c9ef5d556..2d668ca1d 100644 --- a/modules/system/views/mail/partial-table.htm +++ b/modules/system/views/mail/partial-table.htm @@ -1,6 +1,6 @@ name = "Table" == -{{ body }} +{{ body|trim }} ==
{{ body|md_safe }}