Coverage for apps/users/services.py: 33%
15 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-10-27 13:33 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-10-27 13:33 -0600
1from django.conf import settings
2from sentry_sdk import capture_exception
4from app.sendgrid import SendgridClient
7def send_initial_register_password_email(user, url):
8 try:
9 sendgrid = SendgridClient(
10 to_list=[user.email],
11 )
12 sendgrid.send_dynamic_email(
13 template_id=settings.SENDGRID_INITIAL_RESET_PASSWORD_TEMPLATE,
14 dynamic_template_data={
15 "name": user.name,
16 "url": url,
17 },
18 )
19 except Exception as e:
20 capture_exception(e)
23def send_password_reset_email(user, url):
24 try:
25 sendgrid = SendgridClient(
26 to_list=[user.email],
27 )
28 sendgrid.send_dynamic_email(
29 template_id=settings.SENDGRID_RESET_PASSWORD_TEMPLATE,
30 dynamic_template_data={
31 "name": user.name,
32 "url": url,
33 },
34 )
35 except Exception as e:
36 capture_exception(e)