From 46c7f98c9d8ac07984776e00f9842014c154da07 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:30:13 +0530 Subject: [PATCH] dev: update email templates (#2948) * dev: update magic link email * dev: forgot password mail * dev: workspace invitation update * dev: update email templates and task * dev: remove email verification template * dev: change all conversation links to issues --- .../plane/bgtasks/forgot_password_task.py | 2 +- .../plane/bgtasks/magic_link_code_task.py | 8 +- .../bgtasks/workspace_invitation_task.py | 3 +- .../emails/auth/email_verification.html | 11 - .../emails/auth/forgot_password.html | 13 +- .../templates/emails/auth/magic_signin.html | 321 +++++------------- .../invitations/workspace_invitation.html | 10 +- 7 files changed, 111 insertions(+), 257 deletions(-) delete mode 100644 apiserver/templates/emails/auth/email_verification.html diff --git a/apiserver/plane/bgtasks/forgot_password_task.py b/apiserver/plane/bgtasks/forgot_password_task.py index d383ca68a..5348a05da 100644 --- a/apiserver/plane/bgtasks/forgot_password_task.py +++ b/apiserver/plane/bgtasks/forgot_password_task.py @@ -24,7 +24,7 @@ def forgot_password(first_name, email, uidb64, token, current_site): relative_link = ( f"/accounts/password/?uidb64={uidb64}&token={token}&email={email}" ) - abs_url = current_site + relative_link + abs_url = str(current_site) + relative_link instance_configuration = InstanceConfiguration.objects.filter( key__startswith="EMAIL_" diff --git a/apiserver/plane/bgtasks/magic_link_code_task.py b/apiserver/plane/bgtasks/magic_link_code_task.py index d0138c077..2caec2b60 100644 --- a/apiserver/plane/bgtasks/magic_link_code_task.py +++ b/apiserver/plane/bgtasks/magic_link_code_task.py @@ -21,11 +21,6 @@ from plane.license.utils.instance_value import get_email_configuration @shared_task def magic_link(email, key, token, current_site): try: - if current_site: - realtivelink = f"/magic-sign-in/?password={token}&key={key}" - abs_url = current_site + realtivelink - else: - abs_url = "" instance_configuration = InstanceConfiguration.objects.filter( key__startswith="EMAIL_" @@ -69,7 +64,7 @@ def magic_link(email, key, token, current_site): # Send the mail subject = f"Your unique Plane login code is {token}" - context = {"code": token} + context = {"code": token, "email": email} html_content = render_to_string("emails/auth/magic_signin.html", context) text_content = strip_tags(html_content) @@ -93,6 +88,7 @@ def magic_link(email, key, token, current_site): msg.send() return except Exception as e: + print(e) capture_exception(e) # Print logs if in DEBUG mode if settings.DEBUG: diff --git a/apiserver/plane/bgtasks/workspace_invitation_task.py b/apiserver/plane/bgtasks/workspace_invitation_task.py index dc2f1c2c9..2cbfdaff7 100644 --- a/apiserver/plane/bgtasks/workspace_invitation_task.py +++ b/apiserver/plane/bgtasks/workspace_invitation_task.py @@ -35,7 +35,7 @@ def workspace_invitation(email, workspace_id, token, current_site, invitor): relative_link = f"/workspace-invitations/?invitation_id={workspace_member_invite.id}&email={email}&slug={workspace.slug}" # The complete url including the domain - abs_url = current_site + relative_link + abs_url = str(current_site) + relative_link instance_configuration = InstanceConfiguration.objects.filter( key__startswith="EMAIL_" @@ -133,6 +133,7 @@ def workspace_invitation(email, workspace_id, token, current_site, invitor): return except (Workspace.DoesNotExist, WorkspaceMemberInvite.DoesNotExist) as e: + print("Workspace or WorkspaceMember Invite Does not exists") return except Exception as e: # Print logs if in DEBUG mode diff --git a/apiserver/templates/emails/auth/email_verification.html b/apiserver/templates/emails/auth/email_verification.html deleted file mode 100644 index ea642bbd8..000000000 --- a/apiserver/templates/emails/auth/email_verification.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

- Dear {{first_name}},

- Welcome! Your account has been created. - Verify your email by clicking on the link below
- {{verification_url}} - successfully.

-

- - \ No newline at end of file diff --git a/apiserver/templates/emails/auth/forgot_password.html b/apiserver/templates/emails/auth/forgot_password.html index 8abbfb00f..a58a8cef7 100644 --- a/apiserver/templates/emails/auth/forgot_password.html +++ b/apiserver/templates/emails/auth/forgot_password.html @@ -626,7 +626,8 @@ class="r12-i nl2go-default-textstyle" style=" color: #3b3f44; - font-family: georgia, serif; + font-family: arial, + helvetica, sans-serif; font-size: 16px; line-height: 1.5; word-break: break-word; @@ -717,7 +718,8 @@ display: block; -webkit-text-size-adjust: none; color: #ffffff; - font-family: georgia, serif; + font-family: arial, + helvetica, sans-serif; font-size: 16px; " > @@ -749,7 +751,8 @@ class="r11-i nl2go-default-textstyle" style=" color: #3b3f44; - font-family: georgia, serif; + font-family: arial, + helvetica, sans-serif; font-size: 16px; line-height: 1.5; word-break: break-word; @@ -1079,7 +1082,7 @@ >, and This email was sent to - contact.EMAIL. Please delete + {{email}}. Please delete if you aren't the intended recipient. diff --git a/apiserver/templates/emails/auth/magic_signin.html b/apiserver/templates/emails/auth/magic_signin.html index 06fc5e830..4e47487bd 100644 --- a/apiserver/templates/emails/auth/magic_signin.html +++ b/apiserver/templates/emails/auth/magic_signin.html @@ -148,34 +148,28 @@ padding-right: 0px !important; padding-top: 10px !important; } - .r13-i { - background-color: #ffffff !important; - padding-bottom: 5px !important; - padding-top: 5px !important; - text-align: left !important; - } - .r14-i { - background-color: #ffffff !important; - padding-bottom: 15px !important; - padding-top: 15px !important; - text-align: left !important; - } - .r15-i { - padding-bottom: 0px !important; - padding-left: 15px !important; - padding-right: 15px !important; - padding-top: 0px !important; - } - .r16-c { - box-sizing: border-box !important; - text-align: center !important; + .r13-o { + border-bottom-color: #efefef !important; + border-bottom-width: 1px !important; + border-left-color: #efefef !important; + border-left-width: 1px !important; + border-right-color: #efefef !important; + border-right-width: 1px !important; + border-style: solid !important; + border-top-color: #efefef !important; + border-top-width: 1px !important; + margin: 0 auto 0 0 !important; width: 100% !important; } - .r17-i { - padding-bottom: 5px !important; - padding-top: 5px !important; + .r14-i { + background-color: #e3e6f1 !important; + padding-bottom: 10px !important; + padding-left: 10px !important; + padding-right: 10px !important; + padding-top: 10px !important; + text-align: left !important; } - .r18-o { + .r15-o { border-bottom-color: #efefef !important; border-bottom-width: 2px !important; border-left-color: #efefef !important; @@ -188,34 +182,48 @@ margin: 0 auto 0 0 !important; width: 100% !important; } - .r19-i { + .r16-i { padding-bottom: 5px !important; padding-left: 5px !important; padding-right: 5px !important; padding-top: 5px !important; text-align: left !important; } - .r20-i { + .r17-i { padding-bottom: 5px !important; padding-left: 15px !important; padding-right: 15px !important; padding-top: 5px !important; } - .r21-c { + .r18-c { + box-sizing: border-box !important; + text-align: center !important; + width: 100% !important; + } + .r19-c { box-sizing: border-box !important; width: 100% !important; } - .r22-i { + .r20-i { font-size: 0px !important; padding-bottom: 10px !important; padding-left: 65px !important; padding-right: 65px !important; padding-top: 10px !important; } - .r23-c { + .r21-c { box-sizing: border-box !important; width: 32px !important; } + .r22-o { + border-style: solid !important; + margin-right: 8px !important; + width: 32px !important; + } + .r23-i { + padding-bottom: 5px !important; + padding-top: 5px !important; + } .r24-o { border-style: solid !important; margin-right: 8px !important; @@ -646,49 +654,6 @@ border="0" role="presentation" > - - - - - - - - - @@ -724,7 +704,19 @@

{{code}} +

+

+ Please copy and paste this @@ -748,134 +740,6 @@

- - - - - , and
-
+
This email was sent to - {{email}}. Please delete if - you aren't the intended + {{email}}. Please delete + if you aren't the intended recipient.

diff --git a/apiserver/templates/emails/invitations/workspace_invitation.html b/apiserver/templates/emails/invitations/workspace_invitation.html index f55f4ce58..cdca6d62d 100644 --- a/apiserver/templates/emails/invitations/workspace_invitation.html +++ b/apiserver/templates/emails/invitations/workspace_invitation.html @@ -664,12 +664,13 @@ > {{first_name}} has invited you to join them in - {{workspace_name}} on Plane. + {{workspace_name}}, a workspace for projects and progress, on Plane. Some of our users have told us it's a privilege, but we will let you be the judge of @@ -746,7 +747,8 @@ display: block; -webkit-text-size-adjust: none; color: #ffffff; - font-family: georgia, serif; + font-family: arial, + helvetica, sans-serif; font-size: 16px; " > @@ -1069,7 +1071,7 @@ >, and