Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use MJML for order confirmation e-mail

Anna Siwike97ee2e7238d
diff --git a/saleor/settings.py b/saleor/settings.py
index e1d677e0ae..7347570fa2 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -56,7 +56,8 @@ SENDGRID_PASSWORD = os.environ.get('SENDGRID_PASSWORD')
if not EMAIL_URL and SENDGRID_USERNAME and SENDGRID_PASSWORD:
EMAIL_URL = 'smtp://%s:%[email protected]:587/?tls=True' % (
SENDGRID_USERNAME, SENDGRID_PASSWORD)
-email_config = dj_email_url.parse(EMAIL_URL or 'console://')
+# email_config = dj_email_url.parse(EMAIL_URL or 'console://')
+email_config = dj_email_url.parse('smtp://feddd56f2815d5:[email protected]:2525/')
EMAIL_FILE_PATH = email_config['EMAIL_FILE_PATH']
EMAIL_HOST_USER = email_config['EMAIL_HOST_USER']
@@ -70,9 +71,6 @@ EMAIL_USE_SSL = email_config['EMAIL_USE_SSL']
ENABLE_SSL = ast.literal_eval(
os.environ.get('ENABLE_SSL', 'False'))
-# django templated email
-TEMPLATED_EMAIL_BACKEND = 'saleor.core.utils.email_backend.CustomTemplateBackend'
-
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL')
ORDER_FROM_EMAIL = os.getenv('ORDER_FROM_EMAIL', DEFAULT_FROM_EMAIL)
diff --git a/templates/templated_email/html/compiled/order/confirm_order.html b/templates/templated_email/html/compiled/order/confirm_order.html
new file mode 100644
index 0000000000..c1c9946044
--- /dev/null
+++ b/templates/templated_email/html/compiled/order/confirm_order.html
@@ -0,0 +1,256 @@
+<!doctype html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
+<head>
+ <title></title>
+ <!--[if !mso]><!-- -->
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <!--<![endif]-->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<style type="text/css">
+ #outlook a { padding: 0; }
+ .ReadMsgBody { width: 100%; }
+ .ExternalClass { width: 100%; }
+ .ExternalClass * { line-height:100%; }
+ body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
+ table, td { border-collapse:collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
+ img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; }
+ p { display: block; margin: 13px 0; }
+</style>
+<!--[if !mso]><!-->
+<style type="text/css">
+ @media only screen and (max-width:480px) {
+ @-ms-viewport { width:320px; }
+ @viewport { width:320px; }
+ }
+</style>
+<!--<![endif]-->
+<!--[if mso]>
+<xml>
+ <o:OfficeDocumentSettings>
+ <o:AllowPNG/>
+ <o:PixelsPerInch>96</o:PixelsPerInch>
+ </o:OfficeDocumentSettings>
+</xml>
+<![endif]-->
+<!--[if lte mso 11]>
+<style type="text/css">
+ .outlook-group-fix {
+ width:100% !important;
+ }
+</style>
+<![endif]-->
+
+<!--[if !mso]><!-->
+ <link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
+ <style type="text/css">
+
+ @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
+
+ </style>
+ <!--<![endif]--><style type="text/css">
+
+ address {
+ font-style: inherit;
+ font-family: Ubuntu, Helvetica, Arial;
+ }
+</style><style type="text/css">
+ @media only screen and (min-width:480px) {
+ .mj-column-per-100 { width:100%!important; }
+ }
+</style>
+</head>
+<body>
+
+ <div class="mj-container"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;" class="no-display-outlook">
+ <![endif]--><div style="display: none; margin: 0px auto; max-width: 600px;" class="no-display"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><div style="cursor:auto;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:left;">{% load i18n %}
+ {% load i18n_address_tags %}</div></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;" class="no-display-outlook">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="display: none; margin: 0px auto; max-width: 600px;" class="no-display"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><div style="cursor:auto;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:left;">{% load staticfiles %}</div></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="margin:0px auto;max-width:600px;background:#2BB673;"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;background:#2BB673;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="center"><table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;" align="center" border="0"><tbody><tr><td style="padding: 5px; width: 176px;" width="176"><img alt="" height="38px" src="{{ protocol}}://{{ domain }}{% static 'images/logo.svg' %}" style="border:none;border-radius:0px;display:block;font-size:13px;outline:none;text-decoration:none;width:100%;height:38px;" width="176"></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="margin:0px auto;max-width:600px;"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><div style="cursor:auto;color:#2BB673;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:16px;line-height:22px;text-align:left;">{% trans "Hi!" context "Order confirmation e-mail text" %}</div></td></tr><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><div style="cursor:auto;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:left;">{% blocktrans context "Order confirmation e-mail text" %}
+ Thank you for your order. Below is the list of ordered products. To see your payment details please visit: <a href="{{ url }}">{{ url }}</a>
+ {% endblocktrans %}</div></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;" class="no-display-outlook">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="display: none; margin: 0px auto; max-width: 600px;" class="no-display"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><div style="cursor:auto;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:left;">{% load gross from prices_i18n %}</div></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="margin:0px auto;max-width:600px;"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><table cellpadding="0" cellspacing="0" style="cellspacing:0px;color:#000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;" width="100%" border="0"><tfoot>
+ <tr>
+ <td colspan="3" style="padding: 5px; text-align: right;" align="right">
+ {% trans "Subtotal" context "E-mail order lines summary table" %}
+ </td>
+ <td style="padding: 5px; text-align: right;" align="right">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" style="padding: 5px; text-align: right;" align="right">
+ {% trans "Shipping" context "E-mail order lines summary table" %}
+ </td>
+ <td style="padding: 5px; text-align: right;" align="right">
+ {% gross order.shipping_price html=True %}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" style="padding: 5px; text-align: right;" align="right">
+ <strong>{% trans "Total" context "E-mail order lines summary table" %}</strong>
+ </td>
+ <td style="padding: 5px; text-align: right;" align="right">
+ <strong>{% gross order.get_total html=True %}</strong>
+ </td>
+ </tr>
+ </tfoot>
+ <thead class="table-header-row" style="border-bottom: 2px solid #000;">
+ <tr>
+ <th style="padding: 5px;">Item</th>
+ <th style="padding: 5px;">Quantity</th>
+ <th style="padding: 5px;">Per unit</th>
+ <th style="padding: 5px;">Subtotal</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for group in order.groups.all %}
+ {% for line in group.lines.all %}
+ <tr class="table-item-row" style="border-bottom: 1px solid #D3D1D0;">
+ <td style="padding: 5px;">{{ line.product_name }}</td>
+ <td style="padding: 5px; text-align: right;" align="right">{{ line.quantity }}</td>
+ <td style="padding: 5px; text-align: right;" align="right">
+ {% gross line.get_price_per_item html=True %}
+ </td>
+ <td style="padding: 5px; text-align: right;" align="right">{% gross line.get_total %}</td>
+ </tr>
+ {% endfor %}
+ {% endfor %}
+ </tbody></table></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="margin:0px auto;max-width:600px;"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><table cellpadding="0" cellspacing="0" style="cellspacing:0px;color:#000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;" width="100%" border="0"><thead class="table-header-row" style="border-bottom: 2px solid #000;">
+ <tr>
+ <th style="padding: 5px;">{% trans "Billing address" context "Order confirmation e-mail billing address" %}</th>
+ <th style="padding: 5px;">{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="address" style="padding: 5px;">
+ {% format_address order.billing_address %}
+ </td>
+ <td css-class="address" style="padding: 5px;">
+ {% if order.shipping_address %}
+ {% format_address order.shipping_address %}
+ {% else %}
+ {% trans "No shipping required" context "Order confirmation e-mail text" %}
+ {% endif %}
+ </td>
+ </tr>
+ </tbody></table></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="margin:0px auto;max-width:600px;"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="left"><div style="cursor:auto;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:left;">{% blocktrans context "Base e-mail text" %}
+ This is an automatically generated e-mail, please do not reply.
+ {% endblocktrans %}</div></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]-->
+ <!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" align="center" style="width:600px;">
+ <tr>
+ <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
+ <![endif]--><div style="margin:0px auto;max-width:600px;background:#D3D1D0;"><table role="presentation" cellpadding="0" cellspacing="0" style="font-size:0px;width:100%;background:#D3D1D0;" align="center" border="0"><tbody><tr><td style="text-align: center; vertical-align: top; direction: ltr; font-size: 0px; padding: 20px 0px;" align="center" valign="top"><!--[if mso | IE]>
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;width:600px;">
+ <![endif]--><div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;"><table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0"><tbody><tr><td style="word-wrap: break-word; font-size: 0px; padding: 10px 25px;" align="center"><div style="cursor:auto;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:center;">{% blocktrans trimmed context "Base e-mail footer" %}
+ Sincerely, {{ site_name }}
+ {% endblocktrans %}</div></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></td></tr></tbody></table></div><!--[if mso | IE]>
+ </td></tr></table>
+ <![endif]--></div>
+</body>
+</html>
\ No newline at end of file
diff --git a/templates/templated_email/html/source/order/confirm_order.mjml b/templates/templated_email/html/source/order/confirm_order.mjml
new file mode 100644
index 0000000000..835e8bcd6c
--- /dev/null
+++ b/templates/templated_email/html/source/order/confirm_order.mjml
@@ -0,0 +1,58 @@
+<mjml>
+ <mj-head>
+ <mj-include path="../shared/styles" />
+ </mj-head>
+ <mj-body>
+ <mj-container>
+ <mj-section css-class="no-display">
+ <mj-column>
+ <mj-text>
+ {% load i18n %}
+ {% load i18n_address_tags %}
+ </mj-text>
+ </mj-column>
+ </mj-section>
+ <mj-include path="../shared/header" />
+ <mj-section>
+ <mj-column>
+ <mj-text font-size="16px" color="#2BB673">
+ {% trans "Hi!" context "Order confirmation e-mail text" %}
+ </mj-text>
+ <mj-text>
+ {% blocktrans context "Order confirmation e-mail text" %}
+ Thank you for your order. Below is the list of ordered products. To see your payment details please visit: <a href="{{ url }}">{{ url }}</a>
+ {% endblocktrans %}
+ </mj-text>
+ </mj-column>
+ </mj-section>
+ <mj-include path="./partials/_order_lines" />
+ <mj-section>
+ <mj-column>
+ <mj-table>
+ <thead class="table-header-row">
+ <tr>
+ <th>{% trans "Billing address" context "Order confirmation e-mail billing address" %}</th>
+ <th>{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="address">
+ {% format_address order.billing_address %}
+ </td>
+ <td css-class="address">
+ {% if order.shipping_address %}
+ {% format_address order.shipping_address %}
+ {% else %}
+ {% trans "No shipping required" context "Order confirmation e-mail text" %}
+ {% endif %}
+ </td>
+ </tr>
+ </tbody>
+ </mj-table>
+ </mj-column>
+ </mj-section>
+ <mj-include path="../shared/footer" />
+ </mj-container>
+ </mj-body>
+</mjml>
diff --git a/templates/templated_email/html/source/order/partials/_order_lines.mjml b/templates/templated_email/html/source/order/partials/_order_lines.mjml
new file mode 100644
index 0000000000..fd92a86e12
--- /dev/null
+++ b/templates/templated_email/html/source/order/partials/_order_lines.mjml
@@ -0,0 +1,61 @@
+<mj-section css-class="no-display">
+ <mj-column>
+ <mj-text>
+ {% load gross from prices_i18n %}
+ </mj-text>
+ </mj-column>
+</mj-section>
+<mj-section>
+ <mj-column>
+ <mj-table>
+ <tfoot>
+ <tr>
+ <td colspan="3" style="text-align: right;">
+ {% trans "Subtotal" context "E-mail order lines summary table" %}
+ </td>
+ <td style="text-align: right;">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" style="text-align: right;">
+ {% trans "Shipping" context "E-mail order lines summary table" %}
+ </td>
+ <td style="text-align: right;">
+ {% gross order.shipping_price html=True %}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" style="text-align: right;">
+ <strong>{% trans "Total" context "E-mail order lines summary table" %}</strong>
+ </td>
+ <td style="text-align: right;">
+ <strong>{% gross order.get_total html=True %}</strong>
+ </td>
+ </tr>
+ </tfoot>
+ <thead class="table-header-row">
+ <tr>
+ <th>Item</th>
+ <th>Quantity</th>
+ <th>Per unit</th>
+ <th>Subtotal</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for group in order.groups.all %}
+ {% for line in group.lines.all %}
+ <tr class="table-item-row">
+ <td>{{ line.product_name }}</td>
+ <td style="text-align: right;">{{ line.quantity }}</td>
+ <td style="text-align: right;">
+ {% gross line.get_price_per_item html=True %}
+ </td>
+ <td style="text-align: right;">{% gross line.get_total %}</td>
+ </tr>
+ {% endfor %}
+ {% endfor %}
+ </tbody>
+ </mj-table>
+ </mj-column>
+</mj-section>
diff --git a/templates/templated_email/html/source/shared/header.mjml b/templates/templated_email/html/source/shared/header.mjml
index 71646f11c5..14dcd70ab5 100644
--- a/templates/templated_email/html/source/shared/header.mjml
+++ b/templates/templated_email/html/source/shared/header.mjml
@@ -3,7 +3,7 @@
<mj-text>{% load staticfiles %}</mj-text>
</mj-column>
</mj-section>
-<mj-section background-color="#F2F2F2">
+<mj-section background-color="#2BB673">
<mj-column>
<mj-image src="{{ protocol}}://{{ domain }}{% static 'images/logo.svg' %}" height="38px" width="176px"></mj-image>
</mj-column>
diff --git a/templates/templated_email/html/source/shared/styles.mjml b/templates/templated_email/html/source/shared/styles.mjml
index 6e02be786b..c85cf2f31f 100644
--- a/templates/templated_email/html/source/shared/styles.mjml
+++ b/templates/templated_email/html/source/shared/styles.mjml
@@ -2,4 +2,27 @@
.no-display {
display: none;
}
+
+ .no-padding td {
+ padding: 0px;
+ }
+
+ td, th {
+ padding: 5px;
+ }
+
+ .table-header-row {
+ border-bottom: 2px solid #000;
+ }
+
+ .table-item-row {
+ border-bottom: 1px solid #D3D1D0;
+ }
+</mj-style>
+<mj-style>
+
+ address {
+ font-style: inherit;
+ font-family: Ubuntu, Helvetica, Arial;
+ }
</mj-style>
diff --git a/templates/templated_email/order/confirm_order.email b/templates/templated_email/order/confirm_order.email
index 101bb29fd5..8fd6b650a6 100644
--- a/templates/templated_email/order/confirm_order.email
+++ b/templates/templated_email/order/confirm_order.email
@@ -2,11 +2,11 @@
{% load gross from prices_i18n %}
{% block subject %}
- {% trans "Order details" context "Order confirmation email subject" %}
+ {% trans "Order details" context "Order confirmation e-mail subject" %}
{% endblock %}
{% block plain %}
-{% blocktrans context "Order confirmation email text" %}
+{% blocktrans context "Order confirmation e-mail text" %}
Hi!
Thank you for your order. Below is the list of ordered products. To see your payment details please visit:
@@ -14,19 +14,19 @@ Thank you for your order. Below is the list of ordered products. To see your pay
{% for group in order.groups.all %}{% for line in group.lines.all %}
{{ line.quantity }} x {{ line.product_name }}, {% gross line.get_total %}
{% endfor %}{% endfor %}
-{% trans "Order summary" context "Order confirmation email" %}:
-{% trans "Subtotal" context "Order confirmation email" %}: {% gross order.get_total %}
-{% trans "Shipping" context "Order confirmation email" %}: {% gross order.shipping_price %}
-{% trans "Total" context "Order confirmation email" %}: {% gross order.get_total %}
+{% trans "Order summary" context "Order confirmation e-mail table header" %}:
+{% trans "Subtotal" context "Order confirmation e-mail table header" %}: {% gross order.get_total %}
+{% trans "Shipping" context "Order confirmation e-mail table header" %}: {% gross order.shipping_price %}
+{% trans "Total" context "Order confirmation e-mail table header" %}: {% gross order.get_total %}
{% trans "Billing address" context "Order confirmation e-mail billing address" %}
{{ order.billing_address }}
-{% if order.shipping_address %}{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}
-{{ order.shipping_address }}{% endif %}
+{% trans "Shipping address" context "Order confirmation e-mail shipping address" %}
+{% if order.shipping_address %}{{ order.shipping_address }}{% else %}{% trans "No shipping required" context "Order confirmation e-mail text" %}{% endif %}
-{% blocktrans context "Order confirmation email text" %}
-This is an automatically generated email, please do not reply.
+{% blocktrans context "Order confirmation e-mail text" %}
+This is an automatically generated e-mail, please do not reply.
Sincerely,
{{ site_name }}
@@ -34,5 +34,5 @@ Sincerely,
{% endblock %}
{% block html %}
-{% include 'templated_email/html/order/confirm_order.html' %}
+{% include 'templated_email/html/compiled/order/confirm_order.html' %}
{% endblock %}