Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Separate notification content from the sending of the notification #43

@jproffitt

Description

@jproffitt

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions