Marco Dinatsoli
Marco Dinatsoli

Reputation: 10590

How to use Python and Mailchimp to send an email?

I have been reading a lot on the Internet to know how I can use Python to send emails using mailchimp API. It seems that the website is so complected and doesn't have any example.

Please, could you guide me to any example including a Python use?

What I tried so far:

But yet, I couldn't know how to send the emails programmatically.

Upvotes: 6

Views: 10793

Answers (1)

mrcrgl
mrcrgl

Reputation: 640

If you want to trigger a campaign see:

https://apidocs.mailchimp.com/api/2.0/campaigns/send.php

The typical module mailchimp at pypi supports it as followed.

from mailchimp import Mailchimp
mailchimp = Mailchimp(api_key)
mailchimp.campaigns.send(campaign_id)

Sourcecode at: https://bitbucket.org/mailchimp/mailchimp-api-python/src/32ed2394d6b49d7551089484221fa3ee019bee37/mailchimp.py?at=master

Hope it helps.

Cheers, mrcrgl

Upvotes: 14

Related Questions