The cron-job era
The classic Python email automation is a scheduled script: query the database, format a string, loop smtplib, hope. It automates the sending and none of the thinking. The subject line is whatever you hardcoded in March.
That architecture also fails quietly: one malformed address mid-loop and the rest of the batch never sends.
Automation is an agent job now
The job changed. An agent can read your data, draft the email, build the segment, and stage the send, and Python becomes the trigger layer: fire an event, call the API, let the platform do email properly.
import requests requests.post( "https://api.nitrosend.com/v1/my/events", headers={"Authorization": "Bearer $NITROSEND_API_KEY"}, json={"name": "report_ready", "contact": "[email protected]"}, )
Events feed flows, flows send the mail, and a human approval gate sits in front of anything an agent stages. You're the director, not the operator.
Why flows and not a smarter cron? The revenue math: flows out-earn campaigns about thirty to one per recipient. Triggered, timed, personalised email is simply a different asset class from the batch blast your script was scheduling.
We run our own email on exactly this architecture: 99.4 percent of Nitrosend's own sends come from flows, at a 98.2 percent delivery success rate. Not a demo. The production stack, eating its own cooking.
And test the pipeline end to end, not the pieces. We once shipped a five-email onboarding sequence, flow live, contact created, everything green, and the welcome email never arrived. The smoke test caught it. Automation you haven't watched fire is automation you don't have.
Silent failures usually live in the plumbing, not the code. One agency's onboarding flow simply stopped triggering one day, and the diagnosis was a DNS change upstream, nothing in the flow at all. Watch the events, not the editor.
Full parameters and responses live in the REST API docs and the API reference.
Go deeper
Sending one-off messages instead? Start with send email with Python. Sending to a list? Read multiple recipients, because the transactional path is the wrong tool for bulk.