django-notification & django-mailer... how do they work together?

1.1k views Asked by At

I'm looking at implementing some email notification in my app. Django-notification or Django-mailer both look appropriate.
I'm reading through the docs and trying to figure out how they work together.

from the docs: http://code.google.com/p/django-mailer/#Sample_Use_Cases

django-mailer should not manage actual subscriptions to events. Consider the "new reply to message board thread" use case. The overall site would need to keep track of which users subscribed to which threads and then when a thread is updated, django-mailer would be asked to send the same message to that list of users. But the django-notification app should keep track of which users subscribed to which threads and similar use cases.

Given this scenario, I don't understand the last line. How do you use django-notification to keep track of what users are subscribed to what threads?
the api for django-notification
https://github.com/jtauber/django-notification/blob/master/docs/usage.txt

makes it look like you can use django-notification to
- define notification types
- do actions like send_now, queue and send

but there is nothing here that indicates how i would subscribe users in the use case described.
Second, in the scenario described, how does django mailer know what to send? does it reuse the definitions from the notification app? it looks like both mailer and notification imlpement "send" functionality....

Can anyone help me understand this better?

1

There are 1 answers

0
mtnpaul On

Django notification is directed at allowing the users to determine how they are notified of different types of "events". For example when a new user joins the site a notification could be generated by the "registration" app and sent to all users of the site. Then depending on each users notification setting(which users can change) the notification system would choose how to deliver that notice to a particular user. It could be delivered via email, sms(requires extension of the notification system), or just on the site itself. Typically, when syncdb is run the various apps (like the registration app) create the unique notice types they will use. For example registration could have both a "new user" and a "user deactivation" notice types. Then a user on their notification settings page can set whether they want to receive that type of notice via email (or sms perhaps).

The django-mailer is just a system for delivering email. It can be used by any app. The django-notification app could use it for sending emails, or the "registration" app could use it for sending a confirmation email (which would not go through the notification system).

In my view if you had a forum app, it would keep track of which users are subscribed to which forums and would generate notices accordingly. A comment app. would keep track of which users commented on which items and generate notices to users accordingly. So to reiterate. The "individual" apps generate notices. The notification app sends out the notices depending on individuals settings. The mailer handles the sending of email (which may or may not be generated by the notification app).