ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
4 replies
AlanK

Still trying to send emails from SQL via Sendgrid

I have tested that I can send an email using the following cURL command:
curl --request POST \
  --url https://api.sendgrid.com/v3/mail/send \
  --header "Authorization: Bearer <somekey>" \
  --header 'Content-Type: application/json' \
  --data '{"personalizations": [{"to": [{"email": "address@email.com.au"}]}],"from": {"email": "address@outlook.com"},"subject": "Sending with SendGrid is Fun","content": [{"type": "text/plain", "value": "and easy to do anywhere, even with cURL"}]}'
curl --request POST \
  --url https://api.sendgrid.com/v3/mail/send \
  --header "Authorization: Bearer <somekey>" \
  --header 'Content-Type: application/json' \
  --data '{"personalizations": [{"to": [{"email": "address@email.com.au"}]}],"from": {"email": "address@outlook.com"},"subject": "Sending with SendGrid is Fun","content": [{"type": "text/plain", "value": "and easy to do anywhere, even with cURL"}]}'

and am now trying to translate this into SQL. Can anyone give me some pointers on how to restructure this to use in a SQL http request?
So far I ahave this
SELECT content::json
  FROM http((
          'POST',
           'https://api.sendgrid.com/v3/mail/send',
           ARRAY[http_header('Authorization','Bearer <somekey>'), http_header('Content-Type: application/json')],
           NULL,
           NULL
        )::http_request)
SELECT content::json
  FROM http((
          'POST',
           'https://api.sendgrid.com/v3/mail/send',
           ARRAY[http_header('Authorization','Bearer <somekey>'), http_header('Content-Type: application/json')],
           NULL,
           NULL
        )::http_request)
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Unable to Send Auth Emails via Sender.net SMTP โ€“ Unexpected Failure
SupabaseSSupabase / help-and-questions
3mo ago
Sending Emails via supabase
SupabaseSSupabase / help-and-questions
5mo ago
I can't send emails.
SupabaseSSupabase / help-and-questions
2mo ago
SendGrid
SupabaseSSupabase / help-and-questions
4y ago