summaryrefslogtreecommitdiffstats
path: root/accounts/backend/mail/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/backend/mail/__init__.py')
-rw-r--r--accounts/backend/mail/__init__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/accounts/backend/mail/__init__.py b/accounts/backend/mail/__init__.py
index c22b037..ecd0d45 100644
--- a/accounts/backend/mail/__init__.py
+++ b/accounts/backend/mail/__init__.py
@@ -5,5 +5,16 @@ class Backend(object):
def __init__(self, app):
self.app = app
- def send(self, recipient, subject, body, sender=None):
+ def _send(self, recipient, content):
raise NotImplementedError()
+
+ def send(self, recipient, template, **kwargs):
+ if recipient is None:
+ return
+
+ tmpl = self.app.jinja_env.get_or_select_template(template)
+
+ kwargs['recipient'] = recipient
+ module = tmpl.make_module(kwargs)
+
+ self._send(recipient, module)