diff --git a/lacommunaute/notification/emails.py b/lacommunaute/notification/emails.py index 4a5601fc2..ba21f835a 100644 --- a/lacommunaute/notification/emails.py +++ b/lacommunaute/notification/emails.py @@ -21,7 +21,11 @@ def send_email(to, params, template_id, kind, bcc=None): if bcc: payload["bcc"] = bcc - response = httpx.post(settings.SIB_SMTP_URL, headers=headers, json=payload) + if settings.DEBUG: + logger.warning(f"Email sent: {payload}") + response = httpx.Response(200, json={"message": "OK"}) + else: + response = httpx.post(settings.SIB_SMTP_URL, headers=headers, json=payload) EmailSentTrack.objects.create( status_code=response.status_code,