Forked from bdeanindy/SparkPost cURL Create (POST) Transmissions API Example
Created
June 11, 2017 09:28
-
-
Save mehranhadidi/1abf10ff114d5b1f697dc9217bb81fd0 to your computer and use it in GitHub Desktop.
cURL POST Example to send an email using the SparkPost Transmissions API
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
curl \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: <REPLACE_WITH_YOUR_API_KEY>" \ | |
-X POST -d '{"options":{"open_tracking":true,"click_tracking":true},"return_path":"bounces@<REPLACE_WITH_YOUR_SENDING_DOMAIN_HERE>","metadata":{"some_useful_metadata":"testing_sparkpost"},"substitution_data":{"signature":"<REPLACE_WITH_YOUR_FIRST_AND_LAST_NAME>"},"recipients":[{"address":{"email":"<REPLACE_WITH_YOUR_EMAIL_ADDRESS>","tags":["learning"],"substitution_data":{"customer_type":"Platinum","first_name":"<REPLACE_WITH_YOUR_FIRST_NAME>"}}}],"content":{"from":{"name":"Awesome Company","email":"testing@<REPLACE_WITH_YOUR_SENDING_DOMAIN>"},"subject":"My first SparkPost Transmission","reply_to":"Awesome Company ","text":"Hi {{address.first_name}}\r\nYou have just sent your first email through SparkPost!\r\nCongratulations,\r\n{{signature}}","html":"<strong>Hi {{address.first_name}},</strong><p>You have just sent your first email through SparkPost!</p><p>Congratulations!</p>{{signature}}"}}' \ | |
https://api.sparkpost.com/api/v1/transmissions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment