Skip to content

Instantly share code, notes, and snippets.

@SteveMarshall
Created October 20, 2015 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveMarshall/0e1278053ce21dc75100 to your computer and use it in GitHub Desktop.
Save SteveMarshall/0e1278053ce21dc75100 to your computer and use it in GitHub Desktop.
Sendgrid bounce checker
#!/usr/bin/env bash
EMAIL=$1
echo $EMAIL
rejections=( spamreports bounces )
for rejection in "${rejections[@]}"
do
printf "${rejection}:\n"
curl "https://sendgrid.com/api/${rejection}.get.json?api_user=${SENDGRID_SMTP_USERNAME}&api_key=${SENDGRID_SMTP_PASSWORD}&email=${EMAIL}"
printf "\n"
done
@SteveMarshall
Copy link
Author

This requires two environment variables to be set to work: SENDGRID_SMTP_USERNAME and SENDGRID_SMTP_PASSWORD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment