I'm trying to set up a simple functionality for sending email notifications. Basically, from the frontend, I want to send a notification when an action occurs. My approach was to create an api function called sendNotifications(), add it to main.wasp, then call it from the frontend as await sendNotifications(to,from,subject,message). The thing is that I need to retrieve some data from the database to add to the body of the email in the backend, so the sendNotification() function should include calls to the db (either context.entity.TableName.... or by calling the 'operational' functions).
Should the sendNotification() be in the operations file, or as an api call?
Please show me an example of the best way to implement this