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
This commit is contained in:
parent
c95a6522ab
commit
46c7f98c9d
7 changed files with 111 additions and 257 deletions
|
|
@ -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_"
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue