What is the recommended means by which one can sen...
# ask-community
m
What is the recommended means by which one can send a slack notification from inside of a task? It looks like the prefect-slack task does not work if called as a function?
m
I've been using the
SlackWebhook
block to do this...
Copy code
from prefect.blocks.notifications import SlackWebhook

slack_webhook_block = SlackWebhook.load("BLOCK_NAME")
slack_webhook_block.notify("Hello from Prefect!")
There is a note in the `notifications.py` code about moving this to
prefect-slack
though.
upvote 2
🙏 1
m
Thanks Mark. Really appreciate it
I've created an issue here as i am not to sure why this would not work. Given there is nothing "prefect-critical" going on inside of
send_chat_message
I do not see a reason as to why .fn() should fail silently