def apply(self, item, policies_list):
# if double opt-in is set up, we use the validation mail to check
# bounce
if 'DoubleOptIn' not in policies_list:
return_path = 'subscription-bounce+{uuid}@{fqdn}'.format(
uuid=item.uuid, fqdn=settings.RETURNPATH_DOMAIN)
message = EmailMessage(
subject='Votre inscription',
body=render_to_string(
'contacts/bounce_check_confirmation.txt',
{'contact': item}),
to=(item.address, ),
from_email='{} <{}>'.format(
settings.SERVICE_MSG_FROM_NAME,
settings.SERVICE_MSG_FROM_EMAIL),
headers={
'Auto-Submitted': 'auto-generated',
'Return-Path': return_path})
message.send()
评论列表
文章目录