Files
django-dav-events/dav_auth/emails.py
heinzel 98a6fc3ce7
All checks were successful
buildbot/tox Build done.
try to make pylint happy
2022-06-08 00:08:09 +02:00

26 lines
857 B
Python

# -*- coding: utf-8 -*-
from dav_base.emails import AbstractMail
class PasswordSetEmail(AbstractMail): # pylint: disable=too-few-public-methods
_subject = 'Zugangsdaten'
_template_name = 'dav_auth/emails/password_set.txt'
def __init__(self, user, password):
self._user = user
self._password = password
def _get_recipients(self):
r = '"{fullname}" <{email}>'.format(fullname=self._user.get_full_name(),
email=self._user.email)
return [r]
def _get_context_data(self, extra_context=None):
context = super()._get_context_data(extra_context=extra_context)
context.update({
'fullname': self._user.get_full_name(),
'username': self._user.username,
'password': self._password
})
return context