baobabsoluciones / baobabsoluciones/cornflow
Be able to automatically send an email when an execution succeeds
- Dominant language
- Python
- Stars
- 21
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Currently, ApplicationCore accepts a `notify` property and, if it is set to True, Airflow automatically sends an email to the adress defined in the `NOTIFICATION_EMAIL` environment variable if an execution fails. No such option exists to send an email when an execution finishes successfully.
**Describe the solution you'd like**
It would be convenient to have a similar funcionality to automatically send an email when an execution finishes succesfully. We could have a separate boolean property `notify_successes` in ApplicationCore, and use the `on_success_callback` to send the email. Ideally, it would be convenient to have a default template for the email, but that could be customized in the Application. It would also be convenient to be able to specify in the Application the name of the environment variable that contains the emails (because when several dags are deployed on a same server, we could want the emails to be sent to a different user for each). We should also have the option to send the email to several users instead of just one.
**Describe alternatives you've considered**
For now, when developping a DAG, it is possible to reproduce this behavior by sending the email at the end of the `solve()` function of the solvers, just before the `return`. However, if an error occurs after (for example, while `ApplicationCore.solve()` is executing the solution checks or sending the results to the server), the email will have been sent before the error occurs.
**Additional context**
I think the possibility to have a default template for the email that could be customized and the possibility to specify the name of the environment variable that contains the email addresses are funcionalities that should be extended to the failure emails as well.
Contributor guide
Assessment
This issue has not been assessed yet.