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

Separate notification content from the sending of the notification #43

Open
jproffitt opened this issue Jan 10, 2018 · 1 comment
Open

Comments

@jproffitt
Copy link
Contributor

jproffitt commented Jan 10, 2018

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.

@seanbermejo
Copy link
Contributor

This would be a great feature. Just like to ask does every backend have to create each SentNotification instance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants