Sendgrid

Send emails and manage contacts via the SendGrid API.

majiayu000 f8faa47 2 files · 1.9 KB Updated 567 repo stars

File contents

SendGrid

Send transactional and marketing emails.

Environment Variables

  • SENDGRID_API_KEY - API key

Send email

curl -s -X POST -H "Authorization: Bearer $SENDGRID_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.sendgrid.com/v3/mail/send" \
  -d '{"personalizations":[{"to":[{"email":"recipient@example.com"}]}],"from":{"email":"sender@example.com"},"subject":"Hello","content":[{"type":"text/plain","value":"Message body"}]}'

List contacts

curl -s -H "Authorization: Bearer $SENDGRID_API_KEY" \
  "https://api.sendgrid.com/v3/marketing/contacts?page_size=10" | jq '.result[] | {id, email, first_name, last_name}'

Get email stats

curl -s -H "Authorization: Bearer $SENDGRID_API_KEY" \
  "https://api.sendgrid.com/v3/stats?start_date=2024-01-01&limit=7" | jq '.[] | {date, stats: .stats[0].metrics | {requests, delivered, opens, clicks}}'

Notes

  • Always confirm before sending emails.

majiayu000/claude-skill-registry-data/tree/main/communication/sendgrid-thinkfleetai-thinkfleet-engine commit f8faa47c24

Frequently asked questions

npx skillmds add majiayu000/sendgrid-3