Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added email sent signal to edx ace #292

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion edx_ace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .recipient import Recipient
from .recipient_resolver import RecipientResolver

__version__ = '1.10.1'
__version__ = '1.11.0'


__all__ = [
Expand Down
3 changes: 3 additions & 0 deletions edx_ace/delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.conf import settings

from edx_ace.errors import RecoverableChannelDeliveryError
from edx_ace.signals import ACE_MESSAGE_SENT
from edx_ace.utils.date import get_current_time

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -60,8 +61,10 @@ def deliver(channel, rendered_message, message):
message.report(f'{channel_type}_delivery_retried', num_seconds)
else:
message.report(f'{channel_type}_delivery_succeeded', True)
ACE_MESSAGE_SENT.send(sender=channel, message=message)
return

delivery_expired_report = f'{channel_type}_delivery_expired'
logger.debug(delivery_expired_report)
message.report(delivery_expired_report, get_current_time() - start_time)
ACE_MESSAGE_SENT.send(sender=channel, message=message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind explaining the logic behind this line?

It seems to be added by mistake.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muhammadadeeltajamul please check the review above and let me know when the notes can be addressed.

7 changes: 7 additions & 0 deletions edx_ace/signals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Signals for the edx_ace app
"""
from django.dispatch import Signal

# signal to indicate that a message has been sent using ace
ACE_MESSAGE_SENT = Signal()
Loading