Info
The following adheres to Send API v3.0
Messages sent through Send API can be regrouped into campaigns to simulate the behavior of a regular Marketing Campaign. This is useful when your transactional needs are advanced statistics
Use the Property Mj-campaign to specify the name of the campaign the message will be classified in. If the campaign doesn't already exist it will be automatically created in Mailjet system.
By default, Mailjet lets you send multiple emails with the same campaign to the same contact. To block this feature, use Mj-deduplicatecampaign with the value 1 to stop contacts from being emailed several times in the same campaign.
# This call sends an email to one recipient within a campaign blocking multiple email to same recipient
curl -s \
-X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/send \
-H 'Content-Type: application/json' \
-d '{
"FromEmail":"pilot@mailjet.com",
"FromName":"Mailjet Pilot",
"Subject":"Your email flight plan!",
"Text-part":"Dear passenger, welcome to Mailjet! May the delivery force be with you!",
"Html-part":"<h3>Dear passenger, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!<br />May the delivery force be with you!",
"Recipients":[
{
"Email": "passenger@mailjet.com"
}
],
"Mj-campaign":"SendAPI_campaign",
"Mj-deduplicatecampaign":1
}'