summaryrefslogtreecommitdiffstats
path: root/accounts/backend/mail/sendmail.py
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/backend/mail/sendmail.py')
-rw-r--r--accounts/backend/mail/sendmail.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/accounts/backend/mail/sendmail.py b/accounts/backend/mail/sendmail.py
index 92b354e..9a39b03 100644
--- a/accounts/backend/mail/sendmail.py
+++ b/accounts/backend/mail/sendmail.py
@@ -10,19 +10,16 @@ from . import Backend
class SendmailBackend(Backend):
- def send(self, recipient, subject, body, sender=None):
- if sender is None:
- sender = self.app.config['MAIL_DEFAULT_SENDER']
-
+ def _send(self, recipient, content):
safe = lambda s: s.split('\n', 1)[0]
- msg = MIMEText(body, _charset='utf-8')
- msg['Subject'] = safe(subject)
+ msg = MIMEText(content.body(), _charset='utf-8')
+ msg['Subject'] = safe(content.subject())
msg['To'] = safe(recipient)
- msg['From'] = safe(sender)
+ msg['From'] = safe(content.sender())
envelope = []
- _, address = parseaddr(safe(sender))
+ _, address = parseaddr(safe(content.sender()))
if address != '':
envelope = ['-f', address]