tlochner95 commented on PR #35546:
URL: https://github.com/apache/airflow/pull/35546#issuecomment-1876128457
I just wanted to thank you for this contribution. I spent a couple of days
on and off trying to figure out if this is possible. I've upgraded to v2.8.0
and am trying this functionality now, but am not able to get it working so far.
Maybe I am doing something wrong, but I have my default_args listed as so:
```
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'email': "{{ var.json.EMAILS_TO_RECEIVE_FAILURE_ALERTS }}",
'email_on_failure': True,
'email_on_retry': True
}
```
However, this is resulting in this error:
```
Traceback (most recent call last):
File
"/home/tlochner/my-local-airflow/.venv/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1000, in _email_alert
send_email(task.email, subject, html_content)
File
"/home/tlochner/my-local-airflow/.venv/lib/python3.8/site-packages/airflow/utils/email.py",
line 80, in send_email
return backend(
File
"/home/tlochner/my-local-airflow/.venv/lib/python3.8/site-packages/airflow/utils/email.py",
line 154, in send_email_smtp
send_mime_email(e_from=mail_from, e_to=recipients, mime_msg=msg,
conn_id=conn_id, dryrun=dryrun)
File
"/home/tlochner/my-local-airflow/.venv/lib/python3.8/site-packages/airflow/utils/email.py",
line 282, in send_mime_email
smtp_conn.sendmail(e_from, e_to, mime_msg.as_string())
File "/usr/lib/python3.8/smtplib.py", line 894, in sendmail
raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'{{
var.json.EMAILS_TO_RECEIVE_FAILURE_ALERTS }}': (501, b'5.1.3 Invalid address')}
```
Am I doing something wrong here? I have my Variable defined in the Airflow
UI, and the value looks like this:
`['[email protected]']`
Any help is greatly appreciated.
Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]