Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29935

Success mail in Airflow

$
0
0

How can I get success mail in airflow after complete execution of a each dags.

This is what I have tried. I am tring to get a success mail on completion of dags Can anyone will help me out. I have import all the files that are required.

i = datetime.now()

default_args = {
'owner': 'owner',
'depeneds_on_past': False,
'start_date': datetime(i.year, i.month, i.day-1),
'email': ['owner@gmail.com'],
'email_on_failure': True,
'email_on_retry': True,
'email_on_success': True,
'retries': 0,
'retry_delay': timedelta(minutes=10)
}

dag = DAG('update', default_args = default_args, 
schedule_interval="0 3 * * *")


t0 = PythonOperator(
task_id='clear',
python_callable=empty_tables,
email_on_failure=True,
email_on_success=True,
email=['owner@gmail.com'],
dag=dag
)

# Add tasks now 
t1 = BashOperator(
task_id='export',
bash_command=script,
dag=dag
)


t2 = PythonOperator(
task_id='load',
python_callable=load,
email_on_failure=True,
email_on_success=True,
email=['owner@gmail.com'],
dag=dag
)



t0 >> t1 >> t2

Viewing all articles
Browse latest Browse all 29935

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>