Hi everyone! How would I trigger "EmailTask" on f...
# ask-community
p
Hi everyone! How would I trigger "EmailTask" on failed/success state for the whole flow? My goal is to send the code error if it fails, and a success message if it doesnt. I've seen the state handlers for gmail but I want to use a custom SMTP. I succeeded on running a task for it but would like it to run only on those specific flow states. Thanks! https://docs.prefect.io/api/latest/tasks/notifications.html
k
You would attach it to the Flow State Handler. It won’t run as a task though, but inside the state handler, you would just call
EmailTask().run()
p
That's a good idea, thanks Kevin 😉
k
In case you need the docs
🙌 1