1. Learn
  2. /
  3. คอร์ส
  4. /
  5. Introduction to Apache Airflow in Python

Connected

แบบฝึกหัด

Implementing an SmtpNotifier

Now that you've successfully created a failure callback, your team lead has asked that all successful Dag runs be sent via email to a team alias. After reviewing the Airflow documentation, you decide that using Airflow's built-in notifier framework is your best option.

The dag and task objects are already imported, the alert_on_failure callback function and the get_sales_data and process_sales_data tasks are already defined for you.

คำแนะนำ

100 XP
  • Import the SMTP notifier object.
  • Add a success callback attribute to the Dag.
  • Send the notification to [email protected].
  • Include a subject.