Features: Add debug logging for send_order_finished_email SMTP results.
This commit is contained in:
parent
54d8889ffa
commit
ee9e8c3275
1 changed files with 10 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from datetime import datetime
|
||||
|
||||
from celery.app import shared_task
|
||||
from celery.utils.log import get_task_logger
|
||||
from constance import config
|
||||
from django.core import mail
|
||||
from django.core.mail import EmailMessage
|
||||
|
|
@ -11,6 +12,8 @@ from django.utils.translation import gettext_lazy as _
|
|||
from core.models import Order, OrderProduct
|
||||
from core.utils.constance import set_email_settings
|
||||
|
||||
logger = get_task_logger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="default")
|
||||
def contact_us_email(contact_info):
|
||||
|
|
@ -111,7 +114,13 @@ def send_order_finished_email(order_pk: str) -> tuple[bool, str]:
|
|||
connection=connection,
|
||||
)
|
||||
email.content_subtype = "html"
|
||||
email.send()
|
||||
result = email.send()
|
||||
logger.debug(
|
||||
"Order %s: Tried to send email to %s, resulted with %s",
|
||||
order.pk,
|
||||
order.user.email,
|
||||
result
|
||||
)
|
||||
|
||||
def send_thank_you_email(ops: list[OrderProduct]):
|
||||
if ops:
|
||||
|
|
|
|||
Loading…
Reference in a new issue