Skip to content

Conversation

kevinrenskers
Copy link
Member

@kevinrenskers kevinrenskers commented Oct 11, 2025

This is a rather substantial refactor for DGN v2. The TL;DR is that the library now makes it a lot easier to have multiple channels that work with digests, like an SMS or Slack channel. And the sent_at status is now stored per channel instead of once per notification.

Improvements

Breaking changes

Class renames

  • Renamed NotificationChannel -> BaseChannel
  • Renamed NotificationFrequency -> BaseFrequency

Model changes

  • Renamed EmailFrequency model to NotificationFrequency model

Method renames

  • Renamed NotificationType.default_email_frequency -> NotificationType.default_frequency
  • Renamed NotificationType.set_email_frequency -> NotificationType.set_frequency
  • Renamed NotificationType.get_email_frequency -> NotificationType.get_frequency
  • Renamed NotificationType.reset_email_frequency_to_default -> NotificationType.reset_frequency_to_default

Command and function renames

  • Renamed the send_digest_emails command to send_notification_digests

API changes

  • The get_notification_preferences function now returns notification_frequency instead of email_frequency
  • The process method moved from individual channel implementations to the BaseChannel class

- Make it easier to send email via different means than just Django's send_mail (closes #12)
- Make it easier to call the send_digest_emails via different means than just Django's management commands (closes #9)
- Renamed NotificationFrequency -> BaseFrequency
- Renamed EmailFrequency model to NotificationFrequency model, it shouldn't be tied to "email" (closes #15)
- Renamed NotificationType.default_email_frequency -> NotificationType.default_frequency
- Renamed NotificationType.set_email_frequency -> NotificationType.set_frequency
- Renamed NotificationType.get_email_frequency -> NotificationType.get_frequency
- Renamed NotificationType.reset_email_frequency_to_default -> NotificationType.reset_frequency_to_default
- Store sent_at per channel instead of once per notification, stored in new NotificationChannel model (closes #16)

Breaking changes: if you made custom channels, frequencies or notification types, than please check the renames above. For most users these renames won't be breaking changes.
* main:
  Improve email sending (#13)

# Conflicts:
#	generic_notifications/channels.py
#	generic_notifications/digest.py
#	tests/test_channels.py
@kevinrenskers kevinrenskers changed the title Store sent_at per channel instead of once per notification - plus a bunch of renames V2: Store sent_at per channel instead of once per notification - plus a bunch of renames Oct 11, 2025
@kevinrenskers kevinrenskers changed the base branch from main to develop October 11, 2025 19:23
@kevinrenskers kevinrenskers force-pushed the feat/improve-channels-frequencies branch from 42e6288 to d2e4df2 Compare October 12, 2025 12:14
@kevinrenskers kevinrenskers changed the title V2: Store sent_at per channel instead of once per notification - plus a bunch of renames Store sent_at per channel instead of once per notification - plus a bunch of renames Oct 12, 2025
@kevinrenskers kevinrenskers requested a review from Copilot October 12, 2025 12:39
Copilot

This comment was marked as resolved.

Show correct usage of the .prefetch() method in the readme
@kevinrenskers kevinrenskers merged commit 25c72bb into develop Oct 12, 2025
1 check passed
@kevinrenskers kevinrenskers deleted the feat/improve-channels-frequencies branch October 12, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store email_sent_at per channel Remove hardcoded "email" references

1 participant