Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/dsw-mailer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- The Wizard's `projectEmailInvitation` template, with a link to `/project-invitations/<hash>`, for people invited to a project by email

### Fixed

- The HTML part of the built-in templates escapes the text entered by users, such as names, project names and comments

## [5.1.0]

Expand Down
2 changes: 1 addition & 1 deletion packages/dsw-mailer/templates/_common/footer.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<br>
<br>
{% if ctx.appTitle and ctx.clientUrl %}
<small>{% trans %}This email was generated from{% endtrans %} <a href="{{ ctx.clientUrl }}" target="_blank">{{ ctx.appTitle }}</a>.</small>
<small>{% trans %}This email was generated from{% endtrans %} <a href="{{ ctx.clientUrl }}" target="_blank">{{ ctx.appTitle|e }}</a>.</small>
<br>
{% endif %}
</td>
Expand Down
2 changes: 1 addition & 1 deletion packages/dsw-mailer/templates/_common/layout.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ ctx.subject }}</title>
<title>{{ ctx.subject|e }}</title>
<style type="text/css">
{% include "_common/style.css" %}
</style>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '_common/layout.html.j2' %}

{%- set url = ctx.clientUrl ~ "/signup/" ~ ctx.userUuid ~ "/" ~ ctx.hash -%}
{%- set userFirstName = ctx.userFirstName -%}
{%- set userFirstName = ctx.userFirstName|e -%}

{% block body %}
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="dswTextBlock" style="min-width: 100%; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
Expand Down Expand Up @@ -73,7 +73,7 @@
<td valign="top" class="dswTextContent" style="padding: 0px 18px 9px; line-height: 150%; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; word-break: break-word; color: #212529; font-family: Helvetica; font-size: 16px; text-align: left;">
<p dir="ltr" style="line-height: 150%; margin: 10px 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; text-align: left;">
{% trans %}Thank you for using DSW!{% endtrans %}<br><br>
{% if ctx.appTitle %}<strong>{{ ctx.appTitle }}</strong> {% trans %}team{% endtrans %}{% endif %}
{% if ctx.appTitle %}<strong>{{ ctx.appTitle|e }}</strong> {% trans %}team{% endtrans %}{% endif %}
</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '_common/layout.html.j2' %}

{%- set url = ctx.clientUrl ~ "/forgotten-password/" ~ ctx.userUuid ~ "/" ~ ctx.hash -%}
{%- set userFirstName = ctx.userFirstName -%}
{%- set userFirstName = ctx.userFirstName|e -%}

{% block body %}
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="dswTextBlock" style="min-width: 100%; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
Expand Down Expand Up @@ -73,7 +73,7 @@
<td valign="top" class="dswTextContent" style="padding: 0px 18px 9px; line-height: 150%; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; word-break: break-word; color: #212529; font-family: Helvetica; font-size: 16px; text-align: left;">
<p dir="ltr" style="line-height: 150%; margin: 10px 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; text-align: left;">
{% trans %}Thank you for using DSW!{% endtrans %}<br><br>
{% if ctx.appTitle %}<strong>{{ ctx.appTitle }}</strong> {% trans %}team{% endtrans %}{% endif %}
{% if ctx.appTitle %}<strong>{{ ctx.appTitle|e }}</strong> {% trans %}team{% endtrans %}{% endif %}
</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '_common/layout.html.j2' %}

{%- set userFirstName = ctx.userFirstName -%}
{%- set tokenName = "<em>" ~ ctx.tokenName ~ "</em>" -%}
{%- set userFirstName = ctx.userFirstName|e -%}
{%- set tokenName = "<em>" ~ ctx.tokenName|e ~ "</em>" -%}
{%- set tokenExpirationDate = ctx.tokenExpiresAt|datetime_format("%d/%m/%Y") -%}
{%- set tokenExpirationTime = ctx.tokenExpiresAt|datetime_format("%H:%M (%Z)") -%}

Expand Down Expand Up @@ -76,10 +76,10 @@
<td valign="top" class="dswTextContent" style="padding: 0px 18px 9px; line-height: 150%; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; word-break: break-word; color: #212529; font-family: Helvetica; font-size: 16px; text-align: left;">
<p dir="ltr" style="line-height: 150%; margin: 10px 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; text-align: left;">
{% if ctx.supportEmail %}
{% trans %}If you did not initiate this action, please contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #007C89; font-weight: normal; text-decoration: underline;">{{ ctx.supportEmail }}</a>.
{% trans %}If you did not initiate this action, please contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail|e }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #007C89; font-weight: normal; text-decoration: underline;">{{ ctx.supportEmail|e }}</a>.
{% endif %}<br><br>
{% trans %}Thank you for using DSW!{% endtrans %}<br><br>
{% if ctx.appTitle %}<strong>{{ ctx.appTitle }}</strong> {% trans %}team{% endtrans %}{% endif %}
{% if ctx.appTitle %}<strong>{{ ctx.appTitle|e }}</strong> {% trans %}team{% endtrans %}{% endif %}
</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '_common/layout.html.j2' %}

{%- set userFirstName = ctx.userFirstName -%}
{%- set tokenName = "<em>" ~ ctx.tokenName ~ "</em>" -%}
{%- set userFirstName = ctx.userFirstName|e -%}
{%- set tokenName = "<em>" ~ ctx.tokenName|e ~ "</em>" -%}
{%- set tokenExpirationDate = ctx.tokenExpiresAt|datetime_format("%d/%m/%Y") -%}
{%- set tokenExpirationTime = ctx.tokenExpiresAt|datetime_format("%H:%M (%Z)") -%}

Expand Down Expand Up @@ -74,10 +74,10 @@
<td valign="top" class="dswTextContent" style="padding: 0px 18px 9px; line-height: 150%; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; word-break: break-word; color: #212529; font-family: Helvetica; font-size: 16px; text-align: left;">
<p dir="ltr" style="line-height: 150%; margin: 10px 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; text-align: left;">
{% if ctx.supportEmail %}
{% trans %}If you encounter any issues, please contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #007C89; font-weight: normal; text-decoration: underline;">{{ ctx.supportEmail }}</a>.
{% trans %}If you encounter any issues, please contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail|e }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #007C89; font-weight: normal; text-decoration: underline;">{{ ctx.supportEmail|e }}</a>.
{% endif %}<br><br>
{% trans %}Thank you for using DSW!{% endtrans %}<br><br>
{% if ctx.appTitle %}<strong>{{ ctx.appTitle }}</strong> {% trans %}team{% endtrans %}{% endif %}
{% if ctx.appTitle %}<strong>{{ ctx.appTitle|e }}</strong> {% trans %}team{% endtrans %}{% endif %}
</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{%- macro projectLink(projectUuid) -%}
{{ ctx.clientUrl }}/projects/{{ projectUuid }}
{%- endmacro -%}
{%- set userFirstName = ctx.userFirstName -%}
{%- set userFirstName = ctx.userFirstName|e -%}

{% block body %}
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="dswTextBlock" style="min-width: 100%; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
Expand Down Expand Up @@ -58,29 +58,29 @@
<td valign="top" class="dswTextContent" style="padding-top: 0; padding-right: 18px; padding-bottom: 9px; padding-left: 18px; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; word-break: break-word; color: #757575; font-family: Helvetica; font-size: 16px; line-height: 150%; text-align: left;">
<p dir="ltr"
style="margin: 0 0 10px 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; line-height: 150%; text-align: left; font-weight: bold;">
<strong>{{ items[0].projectName }}</strong>
<strong>{{ items[0].projectName|e }}</strong>
</p>
{% for item in items %}
<table align="left" border="0" cellpadding="0" cellspacing="0" style="max-width:100%;min-width:100%;border-collapse: separate !important;border: 1px solid #dee2e6; border-radius: 4px; margin-bottom: 10px;" width="100%">
<tbody>
<tr>
<td align="left" valign="middle" style="padding: 10px 15px;">
<p dir="ltr" style="margin: 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; line-height: 150%; text-align: left; font-weight: normal;">
{{ item.text|no_markdown|truncate(140, False, '...') }}
{{ item.text|no_markdown|truncate(140, False, '...')|replace('<', '&lt;') }}
</p>
{% if item.questionTitle %}
<p dir="ltr" style="margin: 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; line-height: 150%; text-align: left; font-weight: normal;">
<i>{% trans %}Question{% endtrans %}</i>: {{ item.questionTitle }}
<i>{% trans %}Question{% endtrans %}</i>: {{ item.questionTitle|e }}
</p>
{% endif %}
<table width="100%" style="border-collapse: separate !important; border: 1px none; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100%">
<tbody>
<tr>
<td style="padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; word-break: break-word; color: #91989E; font-family: Helvetica; font-size: 14px; line-height: 150%; text-align: left; font-style: italic;">
<i>{% trans %}Assigned by{% endtrans %} {{ item.assignedBy.firstName }} {{ item.assignedBy.lastName }}</i>
<i>{% trans %}Assigned by{% endtrans %} {{ item.assignedBy.firstName|e }} {{ item.assignedBy.lastName|e }}</i>
</td>
<td align="right" valign="middle" class="dswButtonContent" style="font-family: Helvetica; font-size: 14px; mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%; text-align: right">
<a href="{{ threadLink(qtnUuid, item.path, item.commentThreadUuid) }}" target="_blank" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #f15a24; font-weight: bold; text-decoration: none;"><strong>{% trans %}Open{% endtrans %}</strong></a>
<a href="{{ threadLink(qtnUuid, item.path, item.commentThreadUuid)|e }}" target="_blank" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #f15a24; font-weight: bold; text-decoration: none;"><strong>{% trans %}Open{% endtrans %}</strong></a>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -118,10 +118,10 @@
<strong><a href="{{ ctx.clientUrl }}/comments?resolved=false" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #f15a24; font-weight: bold; text-decoration: none;">{% trans %}View all comment threads assigned to you{% endtrans %}</a></strong>
<br><br><br>
{% if ctx.supportEmail %}
{% trans %}If any problem occurs contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #f15a24; font-weight: normal; text-decoration: none;">{{ ctx.supportEmail }}</a>.<br><br>
{% trans %}If any problem occurs contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail|e }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #f15a24; font-weight: normal; text-decoration: none;">{{ ctx.supportEmail|e }}</a>.<br><br>
{% endif %}
{% trans %}Thank you for using DSW!{% endtrans %}<br><br>
{% if ctx.appTitle %}<strong>{{ ctx.appTitle }}</strong> {% trans %}team{% endtrans %}{% endif %}
{% if ctx.appTitle %}<strong>{{ ctx.appTitle|e }}</strong> {% trans %}team{% endtrans %}{% endif %}
</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends '_common/layout.html.j2' %}

{%- set userFirstName = ctx.userFirstName -%}
{%- set userFirstName = ctx.userFirstName|e -%}

{% block body %}
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="dswTextBlock" style="min-width: 100%; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
Expand Down Expand Up @@ -74,10 +74,10 @@
<p dir="ltr" style="line-height: 150%; margin: 10px 0; padding: 0; mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #212529; font-family: Helvetica; font-size: 14px; text-align: left;">
{% trans %}In case you did not request this change, you can safely ignore this email.{% endtrans %}<br><br>
{% if ctx.supportEmail %}
{% trans %}If any problem occurs contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #007C89; font-weight: normal; text-decoration: underline;">{{ ctx.supportEmail }}</a>.<br><br>
{% trans %}If any problem occurs contact us via{% endtrans %} <a href="mailto:{{ ctx.supportEmail|e }}" style="mso-line-height-rule: exactly; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #007C89; font-weight: normal; text-decoration: underline;">{{ ctx.supportEmail|e }}</a>.<br><br>
{% endif %}
{% trans %}Thank you for using DSW!{% endtrans %}<br><br>
{% if ctx.appTitle %}<strong>{{ ctx.appTitle }}</strong> {% trans %}team{% endtrans %}{% endif %}
{% if ctx.appTitle %}<strong>{{ ctx.appTitle|e }}</strong> {% trans %}team{% endtrans %}{% endif %}
</p>
</td>
</tr>
Expand Down
Loading
Loading