potiuk commented on issue #35381: URL: https://github.com/apache/airflow/issues/35381#issuecomment-1792108885
I think the ideas of the three of you should be combined into one :) We can have predefined set of templates based on "action" that triggered the notification. And allow users to override them with their own. I think we should make a maximum use of the "configurabilty" - the whole notion of notifier is to use something "ready" rather than write your own custom version of it. Why don't we simply have a `TemplatedSmtpNotifier` that extends SMTPNotifier in the following way: 1) We define three predefined templates for each case 2) We allow the users to override those (how to do it that's a different story - it could be done in local settings for example 3) The templates should be just plain jinja2 templates I think it would also be useful to add a way to selectively disable/enable sending email based on JINJA or even better `python_callable` condition. I saw recently a user (on our slack I think) asking " how do I send notification email only on the last retry" . I think this is a valid point - someone would iike maybe to retry 10 times but send the email only every 5 times. And of course we could ask the user to write custom notifier for that (why not) but having a way where you can encode the condition to send the email without having to subclass the notifier. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
