Notification preferences (digest, realtime) - Implements part of OOIION-563 #437

Merged
merged 14 commits into from Jan 9, 2013

Projects

None yet

2 participants

@swarbhanu
Contributor

What is implemented?

A user is now able to specify the manner in which notifications were sent.

UNS delivery code includes logic to check this flag and send real time to only users who have requested that route. During batch processing, digests notifications are sent to only users that have that option.

The notification preferences include a flag for delivery_enabled (the default being true). If set to False, the user will not receive any notification emails, digest or real time.

How notification preferences are set?

An example:

        from interface.objects import  NotificationPreferences, NotificationDeliveryModeEnum  

        notification_preferences = NotificationPreferences()
        notification_preferences.delivery_mode = NotificationDeliveryModeEnum.REALTIME
        notification_preferences.delivery_enabled = True

        user = UserInfo()
        user.name = 'user_1'
        user.contact.email = 'user_1@gmail.com'
        user.variables.append({'name' : 'notification_preferences', 'value' : notification_preferences})

What if the notification preferences are not set at all for a user?

No harm done. This pull request is backward compatible!

The code checks to see if the notification preferences have been set. If not, then it goes along the way it used to earlier. So if you have not set notification preferences for your user, there will be no harm done. Nothing should break.

What is not implemented?

We have not yet implemented logic that limits number of emails sent to a user in a day,... or hour?... since more clarification is needed regarding the appropriate time window. Also, more clarification is needed regarding whether the UNS will coordinate with a interval timer (scheduler service) in order to determine whether the above limit has been reached.

@daf
Contributor
daf commented Jan 9, 2013

Looks good.

@daf daf merged commit ca5d622 into ooici:master Jan 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment