是否可以基于每个收件人自定义from_name和from_email?我试过这样做,但似乎没有起作用:
message = {
'auto_html': False,
'auto_text': False,
'bcc_address': None,
'to': {'email': recipient['email'], 'type': 'to'},
'from_name': "*|FROM_NAME|*",
'from_email': "*|FROM_EMAIL|*",
'subject': '*|SUBJECT|*',
'text': '*|BODY_TEXT|*',
'html': '*|BODY_HTML|*',
'google_analytics_campaign': None,
'google_analytics_domains': [],
'headers': {},
'important': False,
'inline_css': None,
'merge': True,
'global_merge_vars': [],
'merge_vars': {
'rcpt': recipient['email'],
'vars': [
{'name': 'SUBJECT', 'content': result["subject"]},
{'name': 'BODY_TEXT', 'content': result["text"]},
{'name': 'BODY_HTML', 'content': result["html"]},
{'name': 'FROM_NAME', 'content': result['from']['name']},
{'name': 'FROM_EMAIL', 'content': result['from']['email']}
]
},
'preserve_recipients': False,
'recipient_metadata': [],
'return_path_domain': None,
'signing_domain': None,
'subaccount': "account_id,
'tags': [],
'track_clicks': False,
'track_opens': False,
'tracking_domain': None,
'url_strip_qs': None,
'view_content_link': None,
'metadata': {}
}
这是在Python中完成的,我正在调用messages.send。我收到错误mandrill.ValidationError: Validation error: {"message":{"from_email":"An email address must contain a single @"}}