Я пытаюсь создать send-шаблон с Mandrill, используя Python.Код работает нормально, но я получаю статус «В очереди» вместо «Отправлено».
Мой код:
import mandrill
MANDRILL_API_KEY = 'API-KEY'
email = 'email@example.com'
myEmail = 'email@example.com'
subjectMessage = 'Hi| Welcome Message'
template_content = [{'content': subjectMessage, 'name': 'SUBJECT'}]
mandrill_client = mandrill.Mandrill(MANDRILL_API_KEY)
message = {'to': [{
'email': myEmail,
'name': 'Dear Applicant:',
'type': 'to'
}],
'subject': subjectMessage,
'from_email': email
}
#result = mandrill_client.messages.send(message = message)
result = mandrill_client.messages.send_template(
template_name='test-template', template_content=template_content, message=message, async=False, ip_pool=None, send_at=None)
# result is a dict with metadata about the sent message, including
# if it was successfully sent
print(result)
'''
[{'_id': 'abc123abc123abc123abc123abc123',
'email': 'recipient.email@example.com',
'reject_reason': 'hard-bounce',
'status': 'sent'}]
'''