[Question] Customisation of notification recipients

Issue #114 resolved
Meiyer created an issue

I am looking for a way to filter or customise the email addresses of users when they are notified about messages. The reason is that in our database, some users have their email addresses marked as non-functional (in the auth_user table). I would like to deliver the message to such a user via postman in any case, but to refrain from sending an email notification to the marked email address (which is invalid).

Seems like I need to subclass the Message class, overriding the notify_users method, and then each of the forms WriteForm, AnonymousWriteForm, QuickReplyForm, and FullReplyForm, and furthermore the corresponding views making use of these forms.

Is there a better way?

If not, would it be possible to add support for a filter/customisation feedback function, for the email notification only? (without interference with the existing filters.) This function would be called for each recipient and determine whether and to what email address a notification should be sent.

Comments (7)

  1. Patrick Samson repo owner
    • changed status to open

    Please give more details about your context:

    • how did you mark some email as non-functional (special convention, another table, ...)?
    • did you explore the 'custom User model' capacity as a possible solution?
    • is it right that you want on a per user basis, either no sending, either a sending to an alternative address (and what is its kind of source)?
  2. Meiyer reporter

    I read though the docs and the new setting sounds great! It even takes care of cases I didn't think of. Looking forward to the new release!

    (Could you explain in a bit more detail in the docs, what the two additional parameters “action” and “site” will contain?)

  3. Patrick Samson repo owner

    The implementation is now committed in repository.

    Could you have a try before a public release?

  4. Meiyer reporter

    @Patrick Samson I tested our use case (described in the original message) and POSTMAN_NOTIFICATION_APPROVAL works like a charm.

  5. Log in to comment