Skip to content

Commit

Permalink
Hotfix email domain name (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaimran08 authored Dec 8, 2023
1 parent 3425516 commit d2cf444
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from django.template.loader import render_to_string
from django.utils.html import strip_tags

from studio.settings import DOMAIN


class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
Expand Down Expand Up @@ -35,9 +37,9 @@ def send_verification_email(self):
send_mail(
"Verify your email address on SciLifeLab Serve",
(
"You registered an account on SciLifeLab Serve (serve.scilifelab.se).\n"
f"You registered an account on SciLifeLab Serve ({DOMAIN}).\n"
"Please click this link to verify your email address:"
f" https://serve.scilifelab.se/verify/?token={self.token}"
f" https://{DOMAIN}/verify/?token={self.token}"
"\n\n"
"SciLifeLab Serve team"
),
Expand Down
2 changes: 2 additions & 0 deletions fixtures/projects_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"template": {
"apps": {
"project-netpolicy": {
"permission": "private",
"slug": "netpolicy"
},
"project-vol": {
Expand Down Expand Up @@ -70,6 +71,7 @@
"template": {
"apps": {
"project-netpolicy": {
"permission": "private",
"slug": "netpolicy"
},
"project-vol": {
Expand Down
4 changes: 2 additions & 2 deletions templates/registration/password_reset_email.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}Hey, You're receiving this email because you requested a password reset for your user account on SciLifeLab Serve (serve.scilifelab.se).{% endblocktrans %}
{% load get_setting %}
{% blocktrans %}Hey, You're receiving this email because you requested a password reset for your user account on SciLifeLab Serve {% endblocktrans %}({% get_setting "DOMAIN" %}).


{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{% get_setting "EMAIL_TEMPLATE_PROTOCOL" %}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% get_setting "EMAIL_TEMPLATE_PROTOCOL" %}://{% get_setting "DOMAIN" %}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Your username is your email, in case you've forgotten:" %} {{ user.get_username }}

Expand Down
5 changes: 3 additions & 2 deletions templates/registration/verify_email.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load get_setting %}
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -35,9 +36,9 @@
<body>
<div class="email-container">
<h1>Verify your email address on SciLifeLab Serve</h1>
<p>You registered an account on SciLifeLab Serve (serve.scilifelab.se).</p>
<p>You registered an account on SciLifeLab Serve ({% get_setting 'DOMAIN' %}).</p>
<p>Please click the button below to verify your email address:</p>
<a href="https://serve.scilifelab.se/verify/?token={{ token }}" class="button">Verify Email</a>
<a href="https://{% get_setting 'DOMAIN' %}/verify/?token={{ token }}" class="button">Verify Email</a>
<p>If you did not request this, please ignore this email.</p>
<p>Regards,</p>
<p>SciLifeLab Serve team</p>
Expand Down

0 comments on commit d2cf444

Please sign in to comment.