Created
October 20, 2015 09:02
-
-
Save SteveMarshall/0e1278053ce21dc75100 to your computer and use it in GitHub Desktop.
Sendgrid bounce checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This requires two environment variables to be set to work:
SENDGRID_SMTP_USERNAME
andSENDGRID_SMTP_PASSWORD
.