All work
Entry 02 of 03
Read the walkthrough
- Detect the failed job
- Prepare the alert
- Send it to the team
Overview
I connect a job's result to an email rule. If the result matches the rule, a Python script creates a short alert and sends it to the configured recipients. This example reports an export that stopped because its input file was missing.
What it covers
- Event triggers
- Recipient routing
- Message templates
- SMTP delivery
Inside the alert
A useful subject identifies the job that stopped. The message body gives the reason and the next thing to check, so the recipient can act without searching through a general activity feed.
Send a useful failure alert
- Pick one failure condition, such as an export with a missing input file, and decide who should receive the alert.
- In Python, build a message with the job name in the subject and the failure reason and next check in the body.
- Use smtplib with your SMTP service to send a test failure to the intended inbox, then verify that a successful job sends no alert.