What this prompt does
This prompt asks the AI to build a Python email automation and reporting system rather than a one-off send script. It defines seven steps: query [data_source] for [report_metrics], generate [report_format] reports with charts via [chart_library], render responsive HTML emails with Jinja2, send through [email_provider] in [batch_size] batches, schedule at [schedule], handle bounces and retries, and log every send to [log_destination] — with template inheritance for branding and a CLI for manual triggers and previews.
The structure works because it covers the full path from data to inbox, not just the send. The [report_metrics] variable defines what the report says, [chart_library] and [report_format] shape how it looks, and [batch_size] plus bounce handling make the delivery reliable at volume. Template inheritance keeps branding consistent, and the CLI preview lets you check a report before it goes out to real recipients.
When to use it
- You need recurring branded reports delivered to clients or stakeholders on a
[schedule]. - You want charts and metrics pulled from
[data_source]rendered into responsive HTML emails. - You're sending at volume and need batching plus bounce-and-retry handling.
- You want every send logged to
[log_destination]for auditing and debugging. - You need a CLI to preview a report or trigger a send manually before automating it.
Example output
Expect a complete system: a query layer pulling [report_metrics] from [data_source], a chart generator using [chart_library], Jinja2 templates with inheritance for consistent branding, a sender that batches through [email_provider] at [batch_size], a scheduler for [schedule], bounce-and-retry handling, and logging to [log_destination]. A CLI exposes manual triggers and a preview command — a runnable reporting pipeline rather than a single send function.
Pro tips
- Always preview via the CLI before the first scheduled run — rendered HTML email often looks different from what you expect.
- Keep
[batch_size]within your[email_provider]'s rate limits (the default of 50 is conservative) to avoid throttling. - Be specific in
[report_metrics]; vague metrics produce a report that's busy but not useful. - Match
[chart_library]to your output — Plotly renders interactive charts, but email clients need static images, so confirm the export path. - Set
[log_destination]to something queryable so you can answer "did this client get their report?" without guessing. - Test bounce handling with a known-bad address before going live, since silent bounce loss is the failure mode that erodes trust.