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 a 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 password.
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 connection
return [my_pipeline, email_on_pipeline_failure]