Registry / communication / mailchimp-transactional

mailchimp-transactional

JSON →
library1.4.1pypypi✓ verified 25d ago

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.

pip install mailchimp-transactional
INSTALL
IMPORT
SIG · MAILCHIMP-TRANSACT
M
mailchimp-transactional
communicationpythonv1.4.1
Install
2.9s avg
Import
409ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.422s · 22.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.9s · import 0.396s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mailchimp_transactional
import mailchimp_transactional as MailchimpTransactional from mailchimp_transactional.api_client import ApiClientError try: client = MailchimpTransactional.Client('YOUR_MANDRILL_API_KEY') response = client.users.ping() print('API called successfully: {}'.format(response)) except ApiClientError as error: print('An exception occurred: {}'.format(error.text))
import mailchimp-transactional # SyntaxError — use underscore import mailchimp # wrong package entirely
Install with pip install mailchimp-transactional (hyphen). Import as import mailchimp_transactional (underscore). These are different strings — a consistent LLM confusion source.
messages.send
response = client.messages.send({ 'message': { 'from_email': 'hello@yourdomain.com', 'subject': 'Hello', 'text': 'Welcome!', 'to': [{ 'email': 'recipient@example.com', 'type': 'to' }] } })
# Wrong: using Mailchimp Marketing API key instead of Mandrill/Transactional key client = MailchimpTransactional.Client('YOUR_MAILCHIMP_MARKETING_API_KEY') # Returns 401 Invalid API Key — these are separate keys
The Transactional API uses a Mandrill API key, NOT the Mailchimp Marketing API key. They are separate credentials generated at mandrillapp.com settings, not mailchimp.com.

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)
Debug
Known issues
breakingInstall name and import name differ. pip install mailchimp-transactional (hyphen), then import mailchimp_transactional (underscore). LLMs frequently generate import mailchimp-transactional which is a SyntaxError.
fix
pip install mailchimp-transactional then import mailchimp_transactional as MailchimpTransactional
affects: all
breakingRequires paid Mailchimp Standard plan or higher. The Transactional API (formerly Mandrill) is NOT available on free Mailchimp accounts. Attempting to use a free account API key returns: 'This account does not have access to the Transactional API.'
fix
Upgrade to Mailchimp Standard or Premium plan to enable Transactional. Enable it in Mailchimp account Billing settings.
affects: all
breakingMandrill/Transactional API key is SEPARATE from the Mailchimp Marketing API key. Using the wrong key returns 401 Invalid API Key errors. Transactional keys are generated at mandrillapp.com settings.
fix
Get your Mandrill API key from: mandrillapp.com → Settings → SMTP & API Info → Add API Key. This is a different key from mailchimp.com API keys.
affects: all
gotchaAll API requests are HTTP POST, not RESTful GET/PUT/DELETE. The entire API surface (including read operations like messages.search) uses POST. The Python client handles this transparently but raw HTTP implementations must use POST.
fix
All endpoint calls via the Python client use POST automatically. If calling the API directly: all requests go to https://mandrillapp.com/api/1.0/ENDPOINT.json via POST with JSON body.
affects: all
gotchaThe API base URL is still mandrillapp.com (not mailchimp.com), a legacy artifact of the Mandrill → Mailchimp Transactional rebrand. Documentation still references both names interchangeably.
fix
Use the Python client which handles the base URL. If calling raw: https://mandrillapp.com/api/1.0/ is the correct base.
affects: all
gotchaSending from an unverified domain silently soft-fails or degrades deliverability. DKIM and DMARC must be configured for the sending domain before production use.
fix
Verify your sending domain at mandrillapp.com → Sending Domains. Set up DKIM (TXT record mandrill._domainkey.yourdomain.com) and a DMARC policy (p=none minimum).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mailchimp-transactional'
The package was installed using 'mailchimp-transactional' (hyphen) but is imported using 'mailchimp_transactional' (underscore).
fix
Change the import statement to `import mailchimp_transactional` or `from mailchimp_transactional import Client`.
AttributeError: 'MailchimpTransactionalClient' object has no attribute 'messages'
You are attempting to call an email-related method (like `send`) directly on the client object, rather than through its `messages` sub-client.
fix
Access the `messages` sub-client first: `client.messages.send(message=...)`.
MailchimpTransactionalError: Invalid API Key
The provided API key is incorrect, expired, or the Mailchimp account associated with the key does not have an active Standard plan or higher, which is required for Mailchimp Transactional Email.
fix
Verify your Mailchimp Transactional API key in your Mailchimp account and ensure your account is on a Standard plan or higher.
TypeError: send() missing 1 required positional argument: 'message'
The `client.messages.send()` method requires a dictionary named `message` containing all the email's details (e.g., recipients, subject, body).
fix
Provide a dictionary as the `message` argument: `client.messages.send(message={'to': [{'email': 'recipient@example.com'}], 'from_email': 'sender@example.com', 'subject': 'Test Subject', 'html': '<p>Test content</p>'})`.
Upgrade
Version history
1.4.1latest on PyPI · released Mar 24, 2026
Audit
Dependencies
python-dateutilrequiredRequired. Installed automatically.
sixrequiredRequired. Installed automatically.
urllib3requiredRequired. Installed automatically.
Agent activity
52 hits · last 30 days
node
46
OpenAI (training)
1
Resources