rafalp / Misago

Misago is fully featured modern forum application that is fast, scalable and responsive.
http://misago-project.org
GNU General Public License v2.0
2.54k stars 528 forks source link

Misago mailer #321

Closed rafalp closed 10 years ago

rafalp commented 10 years ago

Misago needs its own module that adds level of abstraction above Django's django.core.mail. This module would use django mailer to implement its features, but would have different philosophy than Django.

Instead of message subject and body, it would accept template name and extra context values. It would then render two templates: template.html and template.txt and extract message subject from template.txt's subject block.

It would propably expose no more than three functions as it's api: send_mail, send_mass_mail and mail_user. The last one is necessary because we can't touch user's email_user() method as this could break possible compatibility with django apps.

rafalp commented 10 years ago

Moving to generic milestone as it will need more complete misago.users app before I'll be able to cover it with tests reasonable.

rafalp commented 10 years ago

Testing harness for mailer will need fake views calling misago.core.mail, as this mailer works exclusively from within views.

This means there will be a gotcha in future when misago attempts to mail people from manage command (primary usecase will be poke about unread alerts). This may be overcame by fakey request factory and automagical resolution of board address.