To send email notifications from your flow code in Prefect, you generally need to set up configurations and potentially use an email block if you are using Prefect Cloud. However, based on the document excerpts I found, it seems that the email notifications feature specifically might only be available on Prefect Cloud.
For more information on setting up notifications and potentially using email blocks for Prefect Cloud, you can refer to the following documentation:
Notifications in Prefect Cloud.
Unfortunately, detailed steps or specifics on using an email block for sending notifications from flow code were not found in the excerpts provided. Therefore, it may help to explore further the Prefect documentation or forum discussions for more precise guidance on implementing this feature.