Campaign methods
POST
campaign/categorizedtask (send)
This method is to send marketing email.
Request url
https://api.sendigo.com/campaign/categorizedtask
Simple campaign with two recipients:
Request body
appId: xxxxxxxxxxxxxxxxxxxxxxxxxx

data:
{
"categories": ["example"],
"baseData": {
"bodyHtml": "Example",
"bodyPlain": null,
"templateSlug": null,
"templateData": [],
"from": "[email protected]",
"fromTitle": null,
"subject": "example",
"replyTo": null,
"replyToTitle": null,
"utmSource": null,
"utmCampaign": null
}
,
"recipients": [{
"to": "[email protected]",
"replacements": {}
},{
"to": "[email protected]",
"replacements": {}
}]

}
Template:
Request body
appId: xxxxxxxxxxxxxxxxxxxxxxxxxx

data:
{
"categories": ["example"],
"baseData": {
"bodyHtml": null,
"bodyPlain": null,
"templateSlug": "template-xxxxxxxxxxx",
"templateData": [],
"from": "[email protected]",
"fromTitle": null,
"subject": "example",
"replyTo": null,
"replyToTitle": null,
"utmSource": null,
"utmCampaign": null
}
,
"recipients": [{
"to": "[email protected]",
"replacements": {}
},{
"to": "[email protected]",
"replacements": {}
}]

}
With replacements and meta data:
Request body
appId: xxxxxxxxxxxxxxxxxxxxxxxxxx

data:
{
"categories": ["example"],
"baseData": {
"bodyHtml": "Example replacement %R#replacement#R%",
"bodyPlain": null,
"templateSlug": null,
"templateData": [],
"from": "[email protected]",
"fromTitle": null,
"subject": "example",
"replyTo": null,
"replyToTitle": null,
"utmSource": null,
"utmCampaign": null
}
,
"recipients": [{
"to": "[email protected],
"replacements": {"replacement":"example1"},
"metadata": {"metadata1":"value1", "metadata2":"value2"}
},{
"to": "[email protected]",
"replacements": {"replacement":"example2"},
"metadata": {"metadata1":"value1", "metadata2":"value2"}
}]

}
Simple campaign with multiple from / fromTitle and subject:
Request body
appId: xxxxxxxxxxxxxxxxxxxxxxxxxx

data:
{
"categories": ["example"],
"baseData": {
"bodyHtml": "Example",
"bodyPlain": null,
"templateSlug": null,
"templateData": [],
"from": [
"[email protected]",
"[email protected]",
"[email protected]"
],
"fromTitle": [
"John",
"Julie"
],
"subject": [
"Example 1",
"Example 2",
"Example 3"
],
"replyTo": null,
"replyToTitle": null,
"utmSource": null,
"utmCampaign": null
}
,
"recipients": [{
"to": "[email protected]",
"replacements": {}
},{
"to": "x[email protected]",
"replacements": {}
}]

}
Method Description
setBodyHtml Required Html text of campaign
setFrom Required Email address from which is sent
* If an array of values is provided, then for each recipient only one random value will be used.
setSubject Required Subject of campaign
* If an array of values is provided, then for each recipient only one random value will be used.
addRecipients Required Recipient model that contains parameters setTo(email) , addReplacement($field, $data)($field is replacement name, $data is a replacement value) and addMetadata ($field, $data)($field is key value, $data metadata value)
setCategories Required Array of strings with task categories
setBodyPlain Optional Plain text of campaign
setFromTitle Optional Name of email address from which is sent
* If an array of values is provided, then for each recipient only one random value will be used.
setReplyTo Optional Email address where to replay
setReplyToTitle Optional Name of email address where to replay
attachments Optional Attachment of campaign
metadata Optional Additional data for recipient
setTemplateSlug() Optional Identificator of template