[in-bulletin] The "mail error: header To is required" error when adding new topic [5.2.2-B2]

[in-bulletin] The "mail error: header To is required" error when adding new topic [5.2.2-B2]

In https://in-portal.atlassian.net/browse/INP-1017 the functionality was developed that allows users to events happened on website. As an example a feature was added that allows users to get email each time a topic/post in a given category or it's sub categories is added.

This is awesome feature, but appears that subscriptions aren't removed automatically, when:

  1. associated user is deleted (if association was done to User ID and not Email directly)

  2. associated item is deleted (e.g. post in a topic)

  3. associated parent item is deleted (e.g. topic of the monitored post)

  4. associated section was deleted (e.g. sub-section on the forum)

The removal of users and sections can be easily tracked in real time, but it's not that easy to track removal of item/parent item because subscriptions can be made to any item in the system and not only topics & posts.

Solution

  1. change SQL returned by "OnGetEventSubscribersQuery" event to also include "UserEmail" column with value of "Users.Email" for that user

  2. change "kEventManager::notifySubscribers" method to send email only when either of "SubscriberEmail" or "UserEmail" are not empty

  3. create scheduled task, that will:

    1. run once a day (e.g. at 00:00)

    2. delete subscription records that doesn't match any existing records in db

Related Discussions

Related Tasks