diff --git a/django_project_base/notifications/base/channels/integrations/aws_ses.py b/django_project_base/notifications/base/channels/integrations/aws_ses.py index f4c9c9e9..73bc71bc 100644 --- a/django_project_base/notifications/base/channels/integrations/aws_ses.py +++ b/django_project_base/notifications/base/channels/integrations/aws_ses.py @@ -89,9 +89,9 @@ def client_send(self, sender: str, recipient: Recipient, msg: dict, dlr_id: str) .client("ses") .send_email( Destination={ - "ToAddresses": [sender], + "ToAddresses": [recipient.email], "CcAddresses": [], - "BccAddresses": [recipient.email], + "BccAddresses": [], }, Message=msg, Source=sender, diff --git a/django_project_base/notifications/base/channels/mail_channel.py b/django_project_base/notifications/base/channels/mail_channel.py index dc8d8a88..acf84481 100644 --- a/django_project_base/notifications/base/channels/mail_channel.py +++ b/django_project_base/notifications/base/channels/mail_channel.py @@ -1,3 +1,4 @@ +import uuid from typing import List from django.conf import settings @@ -24,6 +25,14 @@ def send(self, notification: DjangoProjectBaseNotification, extra_data, **kwargs list(map(int, notification.recipients.split(","))) if notification.recipients else [] ) return len(recipients) + message = self.provider.get_message(notification) + sender = self.sender(notification) + self.provider.client_send( + self.sender(notification), + Recipient(identifier=str(uuid.uuid4()), phone_number="", email=sender), + message, + str(uuid.uuid4()), + ) return super().send(notification=notification, extra_data=extra_data) def get_recipients(self, notification: DjangoProjectBaseNotification, unique_identifier=""):