django-nyt
django-nyt copied to clipboard
Notification Improvements?
Hey there,
I've been running an older fork of django-nyt
with a few tweaks. I have to update my fork to the latest build anyway so I thought I'd check in and see if there's any interest in the specific changes made:
Improved notifymail
with a number of changes:
- Filter notifications only to active users (somewhat mentioned in #136) except handled by
notifymail.py
-
notifymail
checksSetting.interval
to be > -1 before sending notifications.-1
treated as disabling notifications (e-mails) for a user -
notifymail
checks the new fieldSettings.last_sent
and compares it to the user'sinterval
setting before sending mail. This makes cron jobs work properly with set intervals. - Support for HTML e-mail notification templates,
notifymail
tries for the HTML file and falls back to the text file.
Added to the Settings
object:
-
Setting
had a new field addedlast_sent
to store a datetime when notifications were last sent to the user
Added a new setting and option to existing:
- Added
NYT_SEND_ONLY_LATEST
setting to enable e-mail notifications for most recent notification or all unset notifications for the subscription. - Notification interval setting of
-1
to represent disable e-mail notifications,
Improved the content returned by get_notifications
:
- Adding a
target_obj
method toSubscription
to return the target object, if any. - Added
type_lbl
field to returned Json data in addition to theNotficationType.key
that was already included. - Added
target
field to returned Json data, as the string representation of the target object (if any).
@benjaoming would there be any interest in some or all of these things as a PR?
Hi @dwasyl - thanks so much for the detailed menu :)
I have to focus on getting a new release out (which I'm doing now) and after that, I can try to list out which of these things are already changed or fixed - and which would be interesting in a PR.
Thanks!