Function to add a new e-mail do queue
https://rest.crmango.com/api/AddMailCampaignToQueue
Bearer
varchar
Auth token
campaign_id
integer
Campaign id
recipients
array
E-mail addresess where campaign will be send
from_email_name
string
Name of e-mail address
from_email
string
Text before @ symbol in e-mail address
reply_to
string
Email address where user can reply
errors_to_email
string
E-mail where we can send errors
show_campaign_mango
boolean
Show info about campaign in mango
create_campaign_activity
boolean
Create activity about send campaign in mango
created_by
integer
User to assigne activity in mango
send_datetime
timesatmp
When to send e-mail campaign
html_objects
array
E-mail html objects
Function to add a new e-mail do queue
code
integer
Return code
message
varchar
Info message
campaign_uuid
uuid
UUID of the created resource
curl --request POST \
--url 'https://rest.crmango.com/api/AddMailCampaignToQueue' \
--header 'Authorization: Bearer auth_token' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"campaign_id": "12",
"recipients": [
"martin.pekny@gmail.com",
"tomas.pekny@gmail.com"
],
"from_email_name": "Info Crmango.com",
"from_email": "info",
"reply_to": "reply@crmango.com",
"errors_to_email": "error@crmango.com",
"show_campaign_mango": 1,
"create_campaign_activity": 0,
"created_by": 7,
"send_datetime": "2023-11-13 10:34:00",
"html_objects": [
"your html object"
]
}
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://rest.crmango.com/api/AddMailCampaignToQueue',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"data": {
"campaign_id": "12",
"recipients": [
"martin.pekny@gmail.com",
"tomas.pekny@gmail.com"
],
"from_email_name": "Info Crmango.com",
"from_email": "info",
"reply_to": "reply@crmango.com",
"errors_to_email": "error@crmango.com",
"show_campaign_mango": 1,
"create_campaign_activity": 0,
"created_by": 7,
"send_datetime": "2023-11-13 10:34:00",
"html_objects": [
"your html object"
]
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer auth_token',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
echo $response;
var data = JSON.stringify({
"data": {
"campaign_id": "12",
"recipients": [
"martin.pekny@gmail.com",
"tomas.pekny@gmail.com"
],
"from_email_name": "Info Crmango.com",
"from_email": "info",
"reply_to": "reply@crmango.com",
"errors_to_email": "error@crmango.com",
"show_campaign_mango": 1,
"create_campaign_activity": 0,
"created_by": 7,
"send_datetime": "2023-11-13 10:34:00",
"html_objects": [
"your html object"
]
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://rest.crmango.com/api/AddMailCampaignToQueue");
xhr.setRequestHeader("Authorization", "Bearer auth_token");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
import requests
import json
url = "https://rest.crmango.com/api/AddMailCampaignToQueue"
payload = json.dumps({
"data": {
"campaign_id": "12",
"recipients": [
"martin.pekny@gmail.com",
"tomas.pekny@gmail.com"
],
"from_email_name": "Info Crmango.com",
"from_email": "info",
"reply_to": "reply@crmango.com",
"errors_to_email": "error@crmango.com",
"show_campaign_mango": 1,
"create_campaign_activity": 0,
"created_by": 7,
"send_datetime": "2023-11-13 10:34:00",
"html_objects": [
"your html object"
]
}
})
headers = {
'Authorization': 'Bearer auth_token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"code": 201,
"message": "Campaign was added to queue",
"campaign_uuid": "c82e2b71-8b68-4cd4-a4c4-6b62e0bec57c"
}
{
"code": "int",
"message": "string"
}