0

I do not want to use Slack. I 'm just using custom notification(on_failure_callback) function in args for my mailing function. I have used

def task_my_alert(context):
    task_id=context['task'].task_id
    dag_run = context.get('dag_run')
    log_url=context.get('task_instance').log_url
    default_html_content = (
             'Log: <a href={log_url}>Link</a><br>'
             'Getback:<a href={MY_AIRFLOW_IP_ADDRESS}>CLICK FOR BACK</a><br>'

        )
sub=f"dag has errors"
send_email(to='my@email.com', subject=sub ,  html_content=default_html_content)

But the link[a href] is not working for me in my email. ie: I am not getting link in my email. What changes has to be made?

James Z
  • 12,209
  • 10
  • 24
  • 44
Sudarshan
  • 13
  • 5

1 Answers1

0

You might need to set the MIME type to text/html.

Bas Harenslak
  • 2,591
  • 14
  • 14