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?