def mail(user: User, subject: str, template: Union[str, LazyI18nString],
context: Dict[str, Any]=None, event: Event=None, locale: str=None,
headers: dict=None):
from pretalx.mail.models import QueuedMail
headers = headers or {}
with override(locale):
body = str(template)
if context:
body = body.format_map(TolerantDict(context))
QueuedMail(
event=event, to=user.email, subject=str(subject), text=body,
reply_to=headers.get('reply-to'), bcc=headers.get('bcc'),
).send()
评论列表
文章目录