For example when a user creates a new comment, i c...
# off-topic
r
For example when a user creates a new comment, i create a new entry in the db and then a web hook triggers an event that sends an email notification using some email transaction service to the OP about a new post?
g
You could have a trigger function to get email info from a table by user id in the topic, and format your email request. Then you could use the http extension to send to your email provider. You might even be able to use the new pg_net extension (which hooks use) instead of the http extension, but I've not used it yet. Using the hook method you would need an API server (until Supabase functions are here and work with hooks). The API server would format your data, get email address, etc. Then send to your email service.
b
Yeah, i would go with a dedicated api server, i feel those postgres functions using the http extension are kind of a bandaid, and they do not seem so good to debug
r
ok thanks guys..