All work

Entry 02 of 03

Work

Email Alerts

Tell the right person when a job needs attention

  • Python
  • smtplib
  • SMTP
Read the walkthrough
  1. Detect the failed job
  2. Prepare the alert
  3. 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.