mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-12 23:44:51 +02:00
Change log level
This commit is contained in:
parent
5c892dcec5
commit
bf46be5cbc
1 changed files with 4 additions and 2 deletions
|
@ -1,11 +1,13 @@
|
||||||
"""Utilities for sending emails."""
|
"""Utilities for sending emails."""
|
||||||
|
|
||||||
import boto3
|
import boto3
|
||||||
|
import logging
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.template.loader import get_template
|
from django.template.loader import get_template
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class EmailSendingError(RuntimeError):
|
class EmailSendingError(RuntimeError):
|
||||||
|
|
||||||
"""Local error for handling all failures when sending email."""
|
"""Local error for handling all failures when sending email."""
|
||||||
|
@ -20,7 +22,7 @@ def send_templated_email(template_name: str, subject_template_name: str, to_addr
|
||||||
context as Django's HTML templates. context gives additional information
|
context as Django's HTML templates. context gives additional information
|
||||||
that the template may use.
|
that the template may use.
|
||||||
"""
|
"""
|
||||||
print(f"An email was sent! Template name: {template_name} to {to_address}")
|
logger.info(f"An email was sent! Template name: {template_name} to {to_address}")
|
||||||
template = get_template(template_name)
|
template = get_template(template_name)
|
||||||
email_body = template.render(context=context)
|
email_body = template.render(context=context)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue