plane/apiserver/templates/emails/notifications/issue-updates.html
Bavisetti Narayan adf091fa07
fix: email notifications (#3457)
* fix: email-template design

* fix: priority and state new value

* dev: update template with comments, cta text and view issue button.

* dev: fix priority and state

* dev: update data condition

* fix: added avatar url

* fix: comment avatar url

* fix: priority, labels, state design

* style: assignee property

* dev: fix template for comments and profile changes

* fix: spacing between properties

* fix: todo image for state change

* fix: blocking and blocked by value change

* dev: update template summsary

* fix: blocking, duplicate

* fix: comments spacing

* chore: improve `state change` checkbox logic.

* fix: email notification message change

* fix: updated date format

* fix: updates text color

* fix: labels sequence rendering

* fix: schedular time change

---------

Co-authored-by: LAKHAN BAHETI <lakhanbaheti9@gmail.com>
Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
2024-01-24 20:34:32 +05:30

979 lines
36 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Updates on issue</title>
<style type="text/css" emogrify="no">
html {
font-family: system-ui;
}
p,
h1,
h2,
h3,
h4,
ol,
ul {
margin: 0;
}
h-full {
height: 100%;
}
a:hover {
color: #3358d4 !important;
}
</style>
</head>
<body
bgcolor="#ffffff"
text="#3b3f44"
link="#3f76ff"
yahoo="fix"
style="background-color: #f7f9ff; margin: 20px"
>
<div
style="
width: 600px;
table-layout: fixed;
height: 100%;
margin-left: auto;
margin-right: auto;
"
>
<!-- Header -->
<div>
<table style="width: 600px" cellspacing="0">
<tr>
<td>
<div
style="margin-left: 30px; margin-bottom: 20px; margin-top: 20px"
>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/plane-logo.webp"
width="130"
height="40"
border="0"
/>
</div>
</td>
</tr>
</table>
</div>
<!-- Body -->
<div
style="
color: #1f2d5c;
padding: 30px;
border-radius: 4px;
background-color: #fcfcfd;
max-width: 100%;
"
>
<div>
<table style="width: 100%">
<tr>
<td>
<p style="font-size: 1rem; color: #1f2d5c; font-weight: 600">
{{ issue.issue_identifier }} updates
</p>
<p style="font-size: 1rem; font-weight: 500; color: #1f2d5c; line-height: 28px">
{{ issue.name }}: {{ issue.issue_identifier }}
</p>
</td>
</tr>
</table>
<hr
style="
background-color: #f0f0f3;
height: 1px;
border: 0;
margin-top: 15px;
margin-bottom: 15px;
"
/>
<p style="font-size: 1rem;color: #1f2d5c; line-height: 28pxl">
{% if data.1 %}{{ data|length }}{% endif %} {{ summary }}
<span style="font-size: 1rem; font-weight: 700; line-height: 28px">
{{ data.0.actor_detail.first_name}}
{{data.0.actor_detail.last_name }}
</span>
</p>
{% if comments.0 %}
<p style="font-size: 1rem;color: #1f2d5c; line-height: 28px">
{{ comments|length }} {% if comments|length == 1 %}comment was{% else %}comments were{% endif %} left by
<span style="font-size: 1rem; font-weight: 700; line-height: 28px">
{% if comments|length == 1 %}
{{ data.0.actor_detail.first_name }}
{{ data.0.actor_detail.last_name }}
{% else %}
{{ data.0.actor_detail.first_name }}
{{ data.0.actor_detail.last_name }} and others
{% endif %}
</span>
</p>
{% endif %}
{% if mentions and comments.0 and data.0 %}
<p style="font-size: 1rem;color: #1f2d5c; line-height: 28px">
There are 3 new updates, added 1 new comment and, you were
<span style="font-size: 1rem; font-weight: 700; line-height: 28px">
@{{ data.0.actor_detail.first_name}}
{{data.0.actor_detail.last_name }}
</span>
mentioned a comment of this issue.
</p>
{% endif %}
{% for update in data %} {% if update.changes.name %}
<!-- Issue title updated -->
<p style="font-size: 1rem; line-height: 28px; color: #1f2d5c">
The issue title has been updated from “{{update.changes.user.old_value.0}}“ to "{{update.changes.user.new_value|last}}"
</p>
{% endif %}
<!-- Outer update Box start -->
{% if data %}
<div
style="
background-color: #f7f9ff;
border-radius: 8px;
border-style: solid;
border-width: 1px;
border-color: #c1d0ff;
padding: 20px;
margin-top: 15px;
max-width: 100%;
"
>
<!-- Block Heading -->
<div style="padding-bottom: 20px">
<p style="font-size: 0.8rem; font-weight: 600; color: #121a26">
Updates
</p>
</div>
<!-- Property Updates -->
<div
style="
background-color: white;
max-width: 100%;
overflow: hidden;
overflow-wrap: break-word;
word-wrap: break-word;
padding-left: 15px;
padding-bottom: 15px;
"
>
<!-- action performer -->
<table
role="presentation"
cellspacing="0"
cellpadding="0"
style="max-width: 100%"
>
<tr style="border-radius: 8px; margin-top: 20px">
<td style="width: 30px">
{% if update.actor_detail.avatar_url %}
<img src="{{ update.actor_detail.avatar_url }}" width="25" height="25" border="0" />
{% else %}
<table cellspacing="0" cellpadding="0">
<tr>
<td
style="
width: 25px;
height: 25px;
background-color: #4f3422;
border-radius: 50%;
text-align: center;
"
>
<span
style="
color: white;
font-weight: 500;
font-size: 13px;
line-height: 25px;
display: inline-block;
"
>
{{ update.actor_detail.first_name.0 }}
</span>
</td>
</tr>
</table>
{% endif %}
</td>
<td style="padding-top: 20px; padding-bottom: 20px">
<p
style="
font-weight: 500;
font-size: 0.8rem;
color: #1c2024;
width: fit-content;
margin-left: 5px;
"
>
{{ update.actor_detail.first_name }} {{ update.actor_detail.last_name }}
</p>
</td>
<td>
<p
style="
font-weight: 500;
font-size: 0.6rem;
color: #80838d;
margin-left: 10px;
"
>
{{ update.activity_time }}
</p>
</td>
</tr>
</table>
{% if update.changes.target_date %}
<!-- due date changed -->
<table
role="presentation"
style="max-width: 100%; padding-bottom: 15px"
>
<tr>
<td>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/due-date.webp"
width="12"
height="12"
border="0"
style="display: block"
/>
</td>
<td style="padding: 0px; text-align: center">
<div>
<p
style="
padding: 0px;
margin: 0px;
font-size: 0.8rem;
font-weight: 500;
color: #525252;
"
>
Due Date:
</p>
</div>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #171717;
margin-left: 5px;
padding: 0px;
"
>
{{ update.changes.target_date.new_value.0 }}
</p>
</td>
</tr>
</table>
{% endif %} {% if update.changes.duplicate %}
<!-- duplicate changed -->
<table
role="presentation"
style="max-width: 100%; padding-bottom: 15px"
>
<tr>
<td style="overflow-wrap: break-word;">
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/duplicate.webp"
width="12"
height="12"
border="0"
style="display: inline-block"
/>
<span
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
"
>
Duplicate:
</span>
</td>
<td style="padding-left: 5px;">
{% for duplicate in update.changes.duplicate.new_value %}
<span
style="
font-size: 0.8rem;
font-weight: 500;
color: #3a5bc7;
margin-right: 3px;
padding-top: 0px;
"
>
{{ duplicate }}
</span>
{% endfor %}
</td>
</tr>
</table>
{% endif %}
<!-- Assignee changed-->
{% if update.changes.assignees %}
<table
role="presentation"
style="max-width: 100%; padding-bottom: 15px"
>
<tr>
<td>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/assignee.webp"
width="12"
height="12"
border="0"
style="display: block"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
"
>
Assignees:
</p>
</td>
{% if update.changes.assignees.new_value.0 %}
<td>
<p
style="
font-size: 0.8rem;
color: #0d74ce;
background-color: #e6f4fe;
margin-left: 5px;
padding-left: 4px;
padding-right: 4px;
padding-top: 2px;
padding-bottom: 2px;
font-weight: 500;
border-radius: 4px;
"
>
{{ update.changes.assignees.new_value.0 }}
</p>
</td>
{% endif %} {% if update.changes.assignees.new_value.1 %}
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #0d74ce;
margin-left: 2px;
"
>
+{{ update.changes.assignees.new_value|length|add:"-1"}}
more
</p>
</td>
{% endif %} {% if update.changes.assignees.old_value.0 %}
<td>
<p
style="
font-size: 0.8rem;
padding-left: 4px;
padding-right: 4px;
padding-top: 2px;
padding-bottom: 2px;
font-weight: 500;
text-decoration: line-through;
color: #641723;
background-color: #feebec;
margin-left: 5px;
border-radius: 4px;
"
>
{{update.changes.assignees.old_value.0}}
</p>
</td>
{% endif %} {% if update.changes.assignees.old_value.1 %}
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #641723;
margin-left: 2px;
"
>
+{{ update.changes.assignees.old_value|length|add:"-1"}}
more
</p>
</td>
{% endif %}
</tr>
</table>
{% endif %} {% if update.changes.labels %}
<!-- Labels -->
<table
role="presentation"
style="padding-bottom: 15px; max-width: 100%"
>
<tr>
<td>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/labels.webp"
width="12"
height="12"
border="0"
style="display: block"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
"
>
Labels:
</p>
</td>
{% if update.changes.labels.new_value.0 %}
<td>
<p
style="
font-size: 0.8rem;
color: #0d74ce;
background-color: #e6f4fe;
margin-left: 5px;
padding-left: 4px;
padding-right: 4px;
padding-top: 2px;
padding-bottom: 2px;
font-weight: 500;
border-radius: 4px;
"
>
{{update.changes.labels.new_value.0}}
</p>
</td>
{% endif %}
{% if update.changes.labels.new_value.1 %}
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #0d74ce;
margin-left: 2px;
"
>
+{{ update.changes.labels.new_value|length|add:"-1"}} more
</p>
</td>
{% endif %}
{% if update.changes.labels.old_value.0 %}
<td>
<p
style="
font-size: 0.8rem;
padding-left: 4px;
padding-right: 4px;
padding-top: 2px;
padding-bottom: 2px;
font-weight: 500;
text-decoration: line-through;
color: #641723;
background-color: #feebec;
margin-left: 5px;
border-radius: 4px;
"
>
{{update.changes.labels.old_value.0}}
</p>
</td>
{% endif %}
{% if update.changes.labels.old_value.1 %}
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #641723;
margin-left: 2px;
"
>
+{{ update.changes.labels.old_value|length|add:"-1"}} more
</p>
</td>
{% endif %}
</tr>
</table>
{% endif %}
<!-- State changed -->
{% if update.changes.state %}
<table
role="presentation"
style="padding-bottom: 15px; max-width: 100%"
>
<tr>
<td>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/state.webp"
width="12"
height="12"
border="0"
style="display: block"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
"
>
State:
</p>
</td>
<td >
<img
src="{% if update.changes.state.old_value.0 == 'Backlog' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/backlog.webp{% endif %}{% if update.changes.state.old_value.0 == 'In Progress' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/in-progress.webp{% endif %}{% if update.changes.state.old_value.0 == 'Done' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/done.webp{% endif %}{% if update.changes.state.old_value.0 == 'Cancelled' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/cancelled.webp{% endif %}"
width="12"
height="12"
border="0"
style="display: block; margin-left: 5px;"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #60646C;
"
>
{{ update.changes.state.old_value.0 }}
</p>
</td>
<td style="padding-left: 10px; padding-right: 10px;">
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/forward-arrow.webp"
width="16"
height="16"
border="0"
style="display: block;"
/>
</td>
<td >
<img
src="{% if update.changes.state.new_value|last == 'Backlog' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/backlog.webp{% elif update.changes.state.new_value|last == 'In Progress' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/in-progress.webp{% elif update.changes.state.new_value|last == 'Todo' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/todo.webp{% elif update.changes.state.new_value|last == 'Done' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/done.webp{% elif update.changes.state.new_value|last == 'Cancelled' %}https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/cancelled.webp{% endif %}"
width="12"
height="12"
border="0"
style="display: block;"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #60646c;
"
>
{{update.changes.state.new_value|last }}
</p>
</td>
</tr>
</table>
{% endif %} {% if update.changes.link %}
<!-- Link Added -->
<table
role="presentation"
style="padding-bottom: 15px; max-width: 100%"
>
<tr>
<td valign="top">
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/link.webp"
width="12"
height="12"
border="0"
style="display: block; margin-top: 3px;"
/>
</td>
<td valign="top">
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
margin-right: 5px;
"
>
Links:
</p>
</td>
<td>
{% for link in update.changes.link.new_value %}
<a
href="{{link}}"
style="
font-size: 0.8rem;
font-weight: 600;
color: #3a5bc7;
display: block;
padding-bottom: 5px;
"
>
{{ link }}
</a>
{% endfor %}
{% if update.changes.link.old_value|length > 0 %}
{% if update.changes.link.old_value.0 != "None" %}
<p
href=""
style="
font-size: 0.8rem;
font-weight: 500;
color: #60646c;
"
>
2 Links were removed
</p>
{% endif %}
{% endif %}
</td>
</tr>
</table>
{% endif %}
{% if update.changes.priority %}
<!-- Priority changed -->
<table
role="presentation"
style="padding-bottom: 15px; max-width: 100%"
>
<tr>
<td>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/priority.webp"
width="12"
height="12"
border="0"
style="display: block; margin: 0px; padding: 0px"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
margin-right: 5px;
"
>
Priority:
</p>
</td>
<td>
<p
style="
font-size: 0.8rem;
padding-left: 4px;
padding-right: 4px;
padding-bottom: 2px;
font-weight: 500;
border-radius: 4px;
text-transform: capitalize;
{% if update.changes.priority.old_value.0 == 'urgent' %}background-color: #FFDBDC; color: #CE2C31;{% endif %}
{% if update.changes.priority.old_value.0 == 'high' %}background-color: #FFE2C7; color: #F04610;{% endif %}
{% if update.changes.priority.old_value.0 == 'medium' %}background-color: #FEFBE9; color: #E2A336;{% endif %}
{% if update.changes.priority.old_value.0 == 'low' %}background-color: #E9F6E9; color: #2A7E3B;{% endif %}
"
>
{{ update.changes.priority.old_value.0 }}
</p>
</td>
<td style="padding-left: 10px; padding-right: 10px;">
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/forward-arrow.webp"
width="16"
height="16"
border="0"
style="display: block;"
/>
</td>
<td>
<p
style="
font-size: 0.8rem;
padding-left: 4px;
padding-right: 4px;
padding-bottom: 2px;
font-weight: 500;
border-radius: 4px;
text-transform: capitalize;
{% if update.changes.priority.new_value|last == 'urgent' %}background-color: #FFDBDC; color: #CE2C31;{% endif %}
{% if update.changes.priority.new_value|last == 'high' %}background-color: #FEEBEC; color: #CE2C31;{% endif %}
{% if update.changes.priority.new_value|last == 'medium' %}background-color: #FEFBE9; color: #E2A336;{% endif %}
{% if update.changes.priority.new_value|last == 'low' %}background-color: #E9F6E9; color: #2A7E3B;{% endif %}
"
>
{{ update.changes.priority.new_value|last }}
</p>
</td>
</tr>
</table>
{% endif %}
{% if update.changes.blocking.new_value %}
<!-- Blocking changed -->
<table
role="presentation"
style="padding-bottom: 15px; max-width: 100%"
>
<tr style="overflow-wrap: break-word;">
<td>
<img
src="https://plane-marketing.s3.ap-south-1.amazonaws.com/plane-assets/emails/blocking.webp"
width="12"
height="12"
border="0"
style="display: inline-block;"
/>
<span
style="
font-size: 0.8rem;
font-weight: 500;
color: #525252;
margin-right: 5px;
"
>
Blocking:
</span>
</td>
<td>
{% for blocking in update.changes.blocking.new_value %}
<span href="" style="font-size: 0.8rem; font-weight: 500; margin-right: 5px; color: #3358d4;">
{{blocking}}
</span>
{% endfor %}
</td>
</tr>
</table>
{% endif %}
</div>
</div>
{% endif %}
<!-- Outer update Box end -->
{% endfor %} {% if comments.0 %}
<!-- Comments outer update Box -->
<div
style="
max-width: 100%;
background-color: #f7f9ff;
border-radius: 8px;
border-style: solid;
border-width: 1px;
border-color: #c1d0ff;
padding: 20px;
margin-top: 15px;
"
>
<!-- Block Heading -->
<p style="font-size: 0.8rem; font-weight: 600; color: #121a26; padding-bottom: 20px;">
Comments
</p>
<!-- Comments -->
{% for comment in comments %}
<table cellspacing="0">
<tr style="border-radius: 8px">
<td valign="top">
{% if comment.actor_detail.avatar_url %}
<img
src="{{ comment.actor_detail.avatar_url }}"
width="25"
height="25"
border="0"
/>
{% else %}
<table cellspacing="0" cellpadding="0">
<tr>
<td
style="
width: 25px;
height: 25px;
background-color: #4f3422;
border-radius: 50%;
text-align: center;
"
>
<span
style="
color: white;
font-weight: 500;
font-size: 13px;
line-height: 25px;
display: inline-block;
"
>
{{ comment.actor_detail.first_name.0 }}
</span>
</td>
</tr>
</table>
{% endif %}
</td>
<td style="padding-bottom: 15px">
<table>
<tr>
<td>
<p
style="
font-weight: 500;
font-size: 0.8rem;
color: #1c2024;
margin-left: 8px;
"
>
{{ comment.actor_detail.first_name }} {{ comment.actor_detail.last_name }}
</p>
</td>
</tr>
{% for actor_comment in comment.actor_comments.new_value %}
<tr>
<td>
<div
style="
padding: 6px 10px;
margin-left: 10px;
background-color: white;
font-size: 0.8rem;
color: #525252;
margin-top: 5px;
border-radius: 4px;
display: flex;
align-items: center;
"
>
<p>
{{ actor_comment|safe }}
</p>
</div>
</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
</table>
{% endfor %}
</div>
{% endif %}
</div>
<a href="{{ issue_url }}" style="text-decoration: none;">
<div
style="
max-width: min-content;
white-space: nowrap;
background-color: #3e63dd;
padding: 10px 15px;
border: 1px solid #2f4ba8;
border-radius: 4px;
margin-top: 15px;
cursor: pointer;
font-size: 0.8rem;
color: white;
"
>
View issue
</div>
</a>
</div>
<!-- Footer -->
<table style="width: 100%; padding: 20px; justify-content: center">
<tr>
<td>
<div style="font-size: 0.8rem; color: #1c2024">
This email was sent to
<a
href="mailto:{{receiver.email}}"
style="color: #3a5bc7; font-weight: 500; text-decoration: none"
>{{ receiver.email }}.</a
>
If you'd rather not receive this kind of email,
<a
href="{{ issue_url }}"
style="color: #3a5bc7; text-decoration: none"
>you can unsubscribe to the issue</a
>
or
<a
href="{{ user_preference }}"
style="color: #3a5bc7; text-decoration: none"
>manage your email preferences</a
>.
<!-- Github | LinkedIn | Twitter -->
<div style="margin-top: 60px; float: right">
<a
href="https://github.com/makeplane"
target="_blank"
style="margin-left: 10px; text-decoration: none"
>
<img
src="https://creative-assets.mailinblue.com/editor/social-icons/rounded_colored/github_32px.png"
width="25"
height="25"
border="0"
style="display: inline-block"
/>
</a>
<a
href="https://www.linkedin.com/company/planepowers/"
target="_blank"
style="margin-left: 10px; text-decoration: none"
>
<img
src="https://creative-assets.mailinblue.com/editor/social-icons/rounded_colored/linkedin_32px.png"
width="25"
height="25"
border="0"
style="display: inline-block"
/>
</a>
<a
href="https://twitter.com/planepowers"
target="_blank"
style="margin-left: 10px; text-decoration: none"
>
<img
src="https://creative-assets.mailinblue.com/editor/social-icons/rounded_colored/twitter_32px.png"
width="25"
height="25"
border="0"
style="display: inline-block"
/>
</a>
</div>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>