8000 How to send notification via SMS and email · Issue #16 · worthwhile/django-herald · GitHub
[go: up one dir, main page]

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.

How to send notification via SMS and email #16

Open

Description

@jordanmkoncz

I'm wondering how you would recommended using django-herald so that notifications are sent via both SMS and email.

The users in my system will always have an email address, and 90% of them will also have a mobile phone number; both of these are set on my 'User' model. I will have many different types of notifications, and it would be good if I could define them once and have the notification always sent via email, and also via SMS if the user has a mobile phone number set. I plan to use Twilio for sending SMS messages.

Ideally I would want to be able to define the message/content of the notification in just one one place too, with the SMS message being just this plain text message, while the email gets rendered into a HTML email template with the message rendered in this template.

I'm trying to figure out the best way to approach this so that I don't have to create 2 copies of every notification type (one for email and one for SMS) and trigger 2 notifications every time I want to send a notification to a user. Any recommendations?

Activity

  1. jproffitt commented on Sep 4, 2016

    @jproffitt
    Contributor

    That is a very interesting idea. Somehow, I never thought about that. At the top of my head, I'm thinking you could create some sort of base class that mimics the TwilioTextNotification class, but extends from the EmailNotificationClass. That would be difficult to make work with storing in the database though.

    We'll keep this issue open, and see if we can come up with a good way to solve this use case.

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

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

      0