From d439a2a53e680948a75b229739950724b91e2d76 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 1 Aug 2021 21:11:36 -0700 Subject: [PATCH] emails: Create wider marketing email base template. For our marketing emails, we want a width that's more appropriate for newsletter context, vs. the narrow emails we use for transactional content. I haven't figured out a cleaner way to do this than duplicating most of email_base_default.source.html. But it's not a big deal to duplicate, since we've been changing that base template only about once a year. --- scripts/setup/inline_email_css.py | 3 +- .../zerver/emails/custom_email_base.pre.html | 2 +- templates/zerver/emails/email.css | 8 +++ .../emails/email_base_marketing.source.html | 51 +++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 templates/zerver/emails/email_base_marketing.source.html diff --git a/scripts/setup/inline_email_css.py b/scripts/setup/inline_email_css.py index 0d5c7fa160..170572a954 100755 --- a/scripts/setup/inline_email_css.py +++ b/scripts/setup/inline_email_css.py @@ -59,11 +59,12 @@ def inline_template(template_source_name: str) -> None: # template, since we'll end up with 2 copipes of those tags. # Thus, we strip this stuff out if the template extends # another template. - if template_name not in ["email_base_default", "macros"]: + if template_name not in ["email_base_default", "email_base_marketing", "macros"]: output = strip_unnecesary_tags(output) if ( "zerver/emails/compiled/email_base_default.html" in output + or "zerver/emails/compiled/email_base_marketing.html" in output or "zerver/emails/email_base_messages.html" in output ): assert output.count("") == 0 diff --git a/templates/zerver/emails/custom_email_base.pre.html b/templates/zerver/emails/custom_email_base.pre.html index 57f2d941f4..8d2d92277c 100644 --- a/templates/zerver/emails/custom_email_base.pre.html +++ b/templates/zerver/emails/custom_email_base.pre.html @@ -1,4 +1,4 @@ -{% extends "zerver/emails/compiled/email_base_default.html" %} +{% extends "zerver/emails/compiled/email_base_marketing.html" %} {% block illustration %} diff --git a/templates/zerver/emails/email.css b/templates/zerver/emails/email.css index c51af40e19..87742588f3 100644 --- a/templates/zerver/emails/email.css +++ b/templates/zerver/emails/email.css @@ -46,6 +46,10 @@ table td { padding: 10px; } +.container.wide-container { + max-width: 700px; +} + .content { box-sizing: border-box; display: block; @@ -54,6 +58,10 @@ table td { padding: 10px; } +.content.wide-content { + max-width: 780px; +} + .main { background-color: #fff; border-radius: 3px; diff --git a/templates/zerver/emails/email_base_marketing.source.html b/templates/zerver/emails/email_base_marketing.source.html new file mode 100644 index 0000000000..0cd178ca64 --- /dev/null +++ b/templates/zerver/emails/email_base_marketing.source.html @@ -0,0 +1,51 @@ +{% import 'zerver/emails/compiled/macros.html' as macros %} + + + + + + Zulip + + + + + + + + +
  +
+ + {% block illustration %}{% endblock %} + + + {% block preheader %}{% endblock %} + + + + + +
+ + + + +
+ {% block content %}{% endblock %} +
+ {{ _('Swimming fish') }} +
+ +
+
 
+ +