Created
March 9, 2016 05:55
-
-
Save macropin/7e6e31f73d1ee743cfac to your computer and use it in GitHub Desktop.
Sendgrid via CLI / curl
This file contains hidden or 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 | |
# A better example of how tosend email via Sendgrid with curl | |
TO='[email protected]' | |
TONAME='Some Name' | |
SUBJECT='Email Subject' | |
FROM='[email protected]' | |
TEXT='Some message' | |
USER='user' | |
KEY='password' | |
curl --request POST https://api.sendgrid.com/api/mail.send.json \ | |
--data-urlencode "to=${TO}" \ | |
--data-urlencode "toname=${TONAME}" \ | |
--data-urlencode "subject=${SUBJECT}" \ | |
--data-urlencode "text=${TEXT}" \ | |
--data-urlencode "from=${FROM}" \ | |
--data-urlencode "api_user=${USER}" \ | |
--data-urlencode "api_key=${KEY}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment