If you want to send emails automatically through SendGrid when new custom PostgreSQL rows are created, you can do that using Zapier.
You will need:
To connect your PostgreSQL account to Zapier you will need an active PostgreSQL, and a database that you wish to pull data from. To get started with PostgreSQL, including information on how to install the program and how to create a database, go here. You can learn more about getting started with PostgreSQL on Zapier, here.
To link your PostgreSQL to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start here. For more information about getting started with SendGrid on Zapier, go here.
Now test the Zap to make sure it works. Once you’re satisfied with the results, a new SendGrid email will be sent whenever your custom query is matched in your PostgreSQL.
If you ever want to change this PostgreSQL and SendGrid integration, just go to your Zapier dashboard and tweak anything you'd like.