Skip to content

Conversation

@ferruzzi
Copy link
Contributor

@ferruzzi ferruzzi commented Sep 5, 2025

Following up on #53831 and part of #55237

Dags used for manual testing are below. email_operator is a "control" to make sure the SMPT connection is working as expected, email_as_success_callback confirms that existing synchronous notifier is still working, and email_as_success_callback tests the new async functionality


with DAG("email_as_success_callback"):
    BashOperator(
        task_id='example_task',
        bash_command="echo 'Hello World'",
        on_success_callback=[
            SmtpNotifier(to="dferruzzi@gmail.com", subject="Hello from Airflow on_success", html_content="IT WORKS!")
        ],
    )


with DAG('email_operator'):
    EmailOperator(
        task_id='send_email_to_sender',
        to='dferruzzi@gmail.com',
        subject="hello from airflow dag",
        html_content="hello from airflow dag"
    )

with DAG(
    "email_notifier_as_deadline",
    deadline=DeadlineAlert(
        reference=DeadlineReference.DAGRUN_QUEUED_AT,
        interval=timedelta(seconds=1),
        callback=AsyncCallback(
            callback_callable=SmtpNotifier,
            kwargs={
                "to": "dferruzzi@gmail.com",
                "subject": "Airflow deadline missed",
                "html_content": "Your dag ran too long!",
            }
        )
    )
):
    BashOperator(task_id='sleep_for_ten_seconds', bash_command='sleep 10')

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ferruzzi ferruzzi force-pushed the ferruzzi/notifiers/email branch from fdae313 to 53da449 Compare September 5, 2025 20:20
@ferruzzi ferruzzi force-pushed the ferruzzi/notifiers/email branch from 2c6d026 to 5ba509b Compare September 5, 2025 23:30
@ferruzzi ferruzzi force-pushed the ferruzzi/notifiers/email branch from 5ba509b to aee9962 Compare September 6, 2025 03:51
@ferruzzi ferruzzi requested a review from eladkal as a code owner September 8, 2025 19:32
Copy link
Contributor

@ramitkataria ramitkataria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of templating-related suggestions and some nits but otherwise looks good to me!

@potiuk potiuk merged commit 19ab878 into apache:main Sep 12, 2025
89 checks passed
suman-himanshu pushed a commit to suman-himanshu/airflow that referenced this pull request Sep 17, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
Brunda10 pushed a commit to Brunda10/airflow that referenced this pull request Sep 17, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
* Add Async support for SMTP Notifier

* Fix tests and remove context form async support for now

* overengineer the tests to remove magic strings

* fix imports

* fix imports and some small style changes

* Add backcompat checks

* static checks

* fix imports

* PR fixes

* static fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants