You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the email operator when used with a connection is hard coded to use the smtp/smtp_mail_from and email/from_email variables from the airflow configuration. this should be adjusted to check if the connection has these vars set and prefer those instead.
there is a warning about configuration of email from airflow configuration being unsupported soon, so these config vars need to be supported in connections
What you think should happen instead
if smtp_mail_from and from_email are set in extra_vars on a connection it should prefer those
How to reproduce
setup airflow.cfg with incorrect smtp/smtp_mail_from and email/from_email variables.
attempt to override these with variables on an email connection
use the emailoperator with the new connection to send an email
see that the email was sent with the variables set in airflow.cfg
Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
bitnami containers on baremetal debian with docker-compose
Anything else
lines which need to be adjusted to support connection based vars:
ITJamie
changed the title
emailoperator with connection, not pulling from_email/smtp_mail_from, prefering airflow.cfg variable
emailoperator with connection, missing config variable support (from_email), prefering airflow.cfg variable
May 11, 2023
Assigned you, but there is another related in #31219 and likley also it needs to hold on a bit as @hussein-awala does refactoring of the email operator, so maybe it will end up with all of the people involved here reviewing and commenting single PR of @hussein-awala to see if we can improve some cases (cc: @eladkal as well).
Configuring the email operator and email util through Airflow configuration will soon be deprecated. It will be highly recommended to configure them via Airflow connections, as this approach will be fully supported.
There is already an open issue and linked PR for the Email operator #30530, and I'm trying to do the same thing for the send_email util. I am a bit late on this topic as I was very busy with other tasks during the past two weeks. However, I will make an effort to complete it before version 2.6.2.
Apache Airflow version
2.6.0
What happened
the email operator when used with a connection is hard coded to use the smtp/smtp_mail_from and email/from_email variables from the airflow configuration. this should be adjusted to check if the connection has these vars set and prefer those instead.
there is a warning about configuration of email from airflow configuration being unsupported soon, so these config vars need to be supported in connections
What you think should happen instead
if smtp_mail_from and from_email are set in extra_vars on a connection it should prefer those
How to reproduce
setup airflow.cfg with incorrect smtp/smtp_mail_from and email/from_email variables.
attempt to override these with variables on an email connection
use the emailoperator with the new connection to send an email
see that the email was sent with the variables set in airflow.cfg
Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
bitnami containers on baremetal debian with docker-compose
Anything else
lines which need to be adjusted to support connection based vars:
airflow/airflow/utils/email.py
Line 73 in d4dc734
airflow/airflow/utils/email.py
Line 128 in d4dc734
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: