Registry /
communication / mailchimp-transactional
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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.422s · 22.2MB
glibcpy 3.10–3.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)
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).
fixChange 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.
fixAccess 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.
fixVerify 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).
fixProvide 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.