You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, each notification class basically does it all. It specifies WHAT to send and HOW to send it. I think it would be a much more flexible API if the notification classes just specified WHAT to send. Then we would have different backends that could be specified on the notification that tell HOW to send it.
That way you could, for example, have one notification that gets sent a bunch of different ways:
class BlogPostLikedNotification(Notification):
backends = [EmailBackend, TwillioTextBacked, APNSBackend, GCMBackend]
Of course, that will come with a bunch of complications. Each backend will need separate info for who to send to, (the push notification backends need device identifiers, the twilio backend needs a phone number, and the email backend needs an email, etc.) and what to send. (The email backend needs html, the others just plain text, etc)
Something to think about... would of course be a huge refactor.
The text was updated successfully, but these errors were encountered:
Right now, each notification class basically does it all. It specifies WHAT to send and HOW to send it. I think it would be a much more flexible API if the notification classes just specified WHAT to send. Then we would have different backends that could be specified on the notification that tell HOW to send it.
That way you could, for example, have one notification that gets sent a bunch of different ways:
Of course, that will come with a bunch of complications. Each backend will need separate info for who to send to, (the push notification backends need device identifiers, the twilio backend needs a phone number, and the email backend needs an email, etc.) and what to send. (The email backend needs html, the others just plain text, etc)
Something to think about... would of course be a huge refactor.
The text was updated successfully, but these errors were encountered: