2015-06-18 67 views
1

我擁有大約1000個獨特的郵件和獨特的內容。我想批量發送給mandril,即我不想爲我發送的每條消息進行單獨的網絡呼叫。以下文檔顯示了api。但它沒有定義我想要的。如何發送多條消息到mandrill

https://mandrillapp.com/api/docs/messages.python.html

我想

mandrill_client = mandrill.Mandrill('YOUR_API_KEY') 
    messages ={ message1, message2 ....} 

result = mandrill_client.messages.send(messages=messages, async=True, ip_pool='Main Pool', send_at='example send_at') 

我找不到以上。但這是我想要的。

回答

1

試試這個

message = { 
     #other details 
    'from_email': '[email protected]', 
    'from_name': 'Example Name', 
    'to': [{'email': '[email protected]', 
      'name': 'Recipient Name', 
      'type': 'to'},2nd reciepient,....], 
} 
result = mandrill_client.messages.send(messages=messages, async=True)