Skip to content

Instantly share code, notes, and snippets.

@arnaudbreton
Last active August 30, 2017 08:50
Show Gist options
  • Save arnaudbreton/f09ac2dcb1316790a5336756556e5f72 to your computer and use it in GitHub Desktop.
Save arnaudbreton/f09ac2dcb1316790a5336756556e5f72 to your computer and use it in GitHub Desktop.
Send API v3.1 stable blogpost
{
"Messages": [
{
"Errors": [
{
"ErrorIdentifier": "c04ac4d7-1ebd-4c26-a663-ef304578aef7",
"ErrorCode": "send-0008",
"StatusCode": 403,
"ErrorMessage": "\"i-am-not-a-valid-sender@mailjet.com\" is not an authorized sender email address for your account.",
"ErrorRelatedTo": [
"From"
]
}
],
"Status": "error"
}
]
}
{
"Messages": [
{
"Status": "success",
"CustomID": "sapi_v31_demo",
"To": [
{
"Email": "abreton@mailjet.com",
"MessageUUID": "5d4710f5-9aff-4ff8-9d7e-1f0cf9125019",
"MessageID": 70368744188491213,
"MessageHref": "https://api.mailjet.com/v3/REST/message/70368744188491213"
}
],
"Cc": [],
"Bcc": []
},
{
"Status": "success",
"CustomID": "sapi_v31_demo",
"To": [
{
"Email": "abreton@mailjet.com",
"MessageUUID": "0cdb05d9-83bc-40a6-acd1-f42f790eb68d",
"MessageID": 70368744188491214,
"MessageHref": "https://api.mailjet.com/v3/REST/message/70368744188491214"
}
],
"Cc": [],
"Bcc": []
},
{
"Errors": [
{
"ErrorIdentifier": "835927d2-421a-43a0-a482-dc31ee49bf8e",
"ErrorCode": "send-0008",
"StatusCode": 403,
"ErrorMessage": "\"i-am-not-a-valid-sender@mailjet.com\" is not an authorized sender email address for your account.",
"ErrorRelatedTo": [
"From"
]
}
],
"Status": "error"
}
]
}
curl -s \
-X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3.1/send \
-H 'Content-Type: application/json' \
-d '{
"Messages":[
{
"From": {
"Email": "pilot@mailjet.com",
"Name": "Mailjet Pilot"
},
"To": [
{
"Email": "passenger1@mailjet.com",
"Name": "passenger 1"
}
],
"Subject": "Your email flight plan!",
"TextPart": "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!",
"HTMLPart": "<h3>Dear passenger 1, welcome to <a href=\"http://www.mailjet.com\">Mailjet</a>!</h3><br />May the delivery force be with you!",
"URLTags": "param1=1&param2=2"
}
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment