Similar to D8510, this diff provides out-of-box support for sending emails on pipeline failures over the SMTP
This is thin layer that doesn't address advanced (more secure) email auth connection.
So if an OSS user wants a more secure mechanism we could direct them to write their own.
One thing is open for discussion is where we ask the users to input their creds like sender email passwordhow we get the email creds like sender email password.
This diff asks users to put sender email and password directly. Alternatives are:
1. ask for env vars instead
2. to have an entry in the Dagster instance yaml to get those types of configs/tokens.
This diff asks users to put them as env vars. An alternative is to have an entry in the Dagster instance yaml to get those types of configs/tokens.
from dagster import repository
from dagster.utils.email import make_email_on_pipeline_failure_sensor
email_on_pipeline_failure = make_email_on_pipeline_failure_sensor(
smtp_type="STARTTLS", # for less secure connectionemail_to=["firstname.lastname@example.org"],
return [my_pipeline, email_on_pipeline_failure]