hovel/pybbm — pull request #127 by jeromelebleu (2014-06-25 13:50:13+00:00)
Title: refactor topic subscribers' notification in order to optimize it

Attempt to optimize notification by:
- define context variables for templates rendering only once
- exclude post's author from the users QuerySet instead of checking it inside the loop
- use ``send_mass_mail`` to open only one connection to the mail server (it's also provided by django-mailer but only in the new version: https://github.com/pinax/django-mailer/blob/master/mailer/__init__.py#L78)
- remove email validation since it's normally done by the model
- reactivate ``old_lang`` language only once and at the end

I have also added a ``user`` context variable for the email body since it can be needed to make a user-personalized message, e.g. "Hi John!".

Tell me if you disagree with some of those changes or/and if they don't optimize the process!