⚠️ emailer-lib is currently in development, expect breaking changes.
What is emailer-lib?
emailer-lib is a Python package for serializing, previewing, and sending email messages in a consistent, simple structure. It provides utilities to convert emails from different sources (Redmail, Yagmail, MJML, Quarto JSON) into a unified intermediate format, and send them via multiple backends (Gmail, SMTP, Mailgun, etc.).
The package is designed for data science workflows and Quarto projects, making it easy to generate, preview, and deliver rich email content programmatically.
from emailer_lib import (
    quarto_json_to_intermediate_email,
    IntermediateEmail,
    send_intermediate_email_with_gmail,
)
# Read a Quarto email JSON file
email_struct = quarto_json_to_intermediate_email("email.json")
# Preview the email as HTML
email_struct.write_preview_email("preview.html")
# Send the email via Gmail
send_intermediate_email_with_gmail("[email protected]", "your_password", email_struct)- Unified email structure for serialization and conversion
- Convert emails from Redmail, Yagmail, MJML, and Quarto JSON
- Send emails via Gmail, SMTP, Mailgun, and more
- Preview emails as HTML files
- Support for attachments (inline and external)
- Simple API for integration in data science and reporting workflows
If you encounter a bug, have usage questions, or want to share ideas to make this package better, please feel free to file an issue.
For more information, see the docs or open an issue with questions or suggestions!