How to send multiple messages to mandrill

Refresh

April 2019

Views

449 time

1

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 answers

1

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)