How to send multiple messages to mandrill

1k Views Asked by At

I have around 1000 unique mails with unique content. I want to bulk send them to mandril i.e. I dont want to make individual network calls for every message I am sending. The following document shows the api. But it does not define what I want to.

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

What I want

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')

I could not find the above. But this is what I want.

1

There are 1 best solutions below

2
On BEST ANSWER

Try this

 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)