Django电子邮件:获取身体接收器

时间:2017-01-26 23:35:08

标签: python django django-email

我正在使用EmailMultiAlternatives将邮件发送到收件人列表。

context = Context({'cc': cc, 'link': link})
    html_template = loader.get_template('email_new.html')
text_template = loader.get_template('email_new.txt')
from_email = 'afeld <afeld@has_questions.com>'
recipient_list = ['%s <%s>' % (e.full_name(), e.email()) for e in cc.not_responded()]
cc_list = ['%s <%s>' % (e.full_name(), e.email()) for e in cc.notification_recipients()]
message = EmailMultiAlternatives(
    subject,
    text_template.render(context),
    from_email,
    to=recipient_list,
    cc=cc_list
)

是否可以在正文中收到电子邮件的收件人?在我的email.html中看起来像什么

dear {{ recipient }}

from afeld

如何从recipient_list获取{{ recipient }}

0 个答案:

没有答案