Mailchimp Transactional

1.3.3 · active · verified Fri Mar 27

Official Python client for Mailchimp Transactional Email API (formerly Mandrill). Current version is 1.3.3 (Feb 2026). Install name is mailchimp-transactional (hyphen), import name is mailchimp_transactional (underscore). Requires a paid Mailchimp Standard plan or higher — not available on free accounts.

Warnings

Install

Imports

Quickstart

Basic send pattern. Always catch ApiClientError. Verify with users.ping() first.

import mailchimp_transactional as MailchimpTransactional
from mailchimp_transactional.api_client import ApiClientError

client = MailchimpTransactional.Client('YOUR_MANDRILL_API_KEY')

# Verify API key works
try:
    response = client.users.ping()
    print('Ping:', response)  # 'PONG!'
except ApiClientError as e:
    print('Error:', e.text)

# Send a transactional email
try:
    response = client.messages.send({
        'message': {
            'from_email': 'noreply@yourdomain.com',
            'from_name': 'Your App',
            'subject': 'Password Reset',
            'html': '<p>Click <a href="{reset_url}">here</a> to reset your password.</p>',
            'to': [{'email': 'user@example.com', 'type': 'to'}],
            'track_opens': True,
            'track_clicks': True
        }
    })
    print('Sent:', response)
except ApiClientError as e:
    print('Send failed:', e.text)

view raw JSON →