Coverage for apps/users/services.py: 44%
9 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-09-22 14:26 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-09-22 14:26 -0600
1from django.conf import settings
2from sentry_sdk import capture_exception
4from app.sendgrid import SendgridClient
7def send_password_reset_email(user, url):
8 try:
9 sendgrid = SendgridClient(
10 to=user.email,
11 )
12 sendgrid.send_dynamic_email(
13 template_id=settings.SENDGRID_RESET_PASSWORD_TEMPLATE,
14 dynamic_template_data={
15 "name": f"{user.first_name} {user.last_name}",
16 "url": url,
17 },
18 )
19 except Exception as e:
20 capture_exception(e)