Skip to content

Commit

Permalink
Replace first task with new model
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 19, 2023
1 parent ce12040 commit 4640f41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,6 @@
GIP_CONTACT_EMAIL = env("GIP_CONTACT_EMAIL", default="[email protected]")

# Transactional email templates
# -- user: new user password reset
MAILJET_NEW_USER_PASSWORD_RESET_ID = env.int("MAILJET_NEW_USER_PASSWORD_RESET_ID", 4216730)

# -- siae: completion
MAILJET_SIAE_COMPLETION_REMINDER_TEMPLATE_ID = env.int("MAILJET_SIAE_COMPLETION_REMINDER_TEMPLATE_ID", 4791779)

Expand Down
9 changes: 6 additions & 3 deletions lemarche/www/auth/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode

from lemarche.conversations.models import TemplateTransactional
from lemarche.users import constants as user_constants
from lemarche.users.models import User
from lemarche.utils.apis import api_hubspot, api_mailjet
Expand Down Expand Up @@ -43,7 +44,7 @@ def send_signup_notification_email(user):


def send_new_user_password_reset_link(user: User):
email_subject = "Finalisez votre inscription sur le marché de l'inclusion"
email_template = TemplateTransactional.objects.get(code="NEW_USER_PASSWORD_RESET")
recipient_list = whitelist_recipient_list([user.email])
if recipient_list:
recipient_email = recipient_list[0] if recipient_list else ""
Expand All @@ -55,11 +56,13 @@ def send_new_user_password_reset_link(user: User):
}

api_mailjet.send_transactional_email_with_template(
template_id=settings.MAILJET_NEW_USER_PASSWORD_RESET_ID,
subject=email_subject,
template_id=email_template.get_template_id,
subject=email_template.email_subject,
recipient_email=recipient_email,
recipient_name=recipient_name,
variables=variables,
from_email=email_template.email_from_email,
from_name=email_template.email_from_name,
)


Expand Down

0 comments on commit 4640f41

Please sign in to comment.