With this function, it is possible to schedule a one-time sending of the campaign. A campaign can have several campaign deliveries scheduled at the same time. To cancel a mailing, you must use the mailkit.campaigns.schedule.cancel function.
API call example:
JSON
{
"function":"mailkit.campaigns.single.schedule",
"id":"client_id",
"md5":"client_md5",
"parameters":{
"ID_message": "campaign ID",
"subject": "Campaign subject",
"send_date": "now",
"time_zone": "",
"ID_delivery_feed": "1234",
"ID_query":"ID of the stored query"
}
}
XML
<?xml version="1.0"?>
<methodCall>
<methodName>mailkit.campaigns.single.schedule</methodName>
<params>
<param>
<value>
<int>client_id</int>
</value>
</param>
<param>
<value>
<string>client_md5</string>
</value>
</param>
<param>
<value>
<int>ID_message</int>
</value>
</param>
<param>
<value>
<string>subject</string>
</value>
</param>
<param>
<value>
<string>send_date</string>
</value>
</param>
<param>
<value>
<string>time_zone</string>
</value>
</param>
<!-- start of empty parameter -->
<param>
<value>
<string></string>
</value>
</param>
<!-- end of empty parameter -->
<param>
<value>
<string>ID_template</string>
</value>
</param>
<param>
<value>
<struct>
<member>
<name>ID_query</name>
<value>
<string>123</string>
</value>
</member>
<member>
<name>ID_delivery_feed</name>
<value>
<string>123</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
Values
client_id * = client ID can be found in your Mailkit account's menu Profile/Integration.
client_md5 * = MD5 code can be found in your Mailkit account's menu Profile/Integration.
ID_message * = ID of campaign
subject = subject of campaign (optional). In case the value for the subject is not sent in the call, the subject set in the campaign will be used.
send_date * = date of campaign delivery: rrrr-mm-dd hh:mm, or 'now' for immediate delivery
time_zone ** = name of time zone the send_date is related to (as returned by mailkit.campaigns.schedule.timezones)
empty parameter = empty branch (is ignored) to maintain backward compatibility
ID_template = ID of template
ID_query = ID of stored Query for Delivery capping (returned by mailkit.profile.queries.list). If the value for ID_query in the API call is not sent and at the same time Delivery capping is set in the campaign, the rules set in Delivery capping will be used for the campaign delivery. If a value for ID_query is sent in the API call and at the same time Delivery capping is set in the campaign, the condition sent in the API call will be applied (i.e. the Delivery capping set in the campaign will be ignored).
ID_delivery_feed = ID of delivery feed to use
* required value
** required value in case the send_date parameter is set to a specific date/time (in the case of the "now" value for the send_date parameter, the time_zone parameter is ignored)
Successful call response:
JSON
{
"error": "OK, send_date: 2022-05-13 12:45:00 (Europe/Prague)",
"error_status": 0
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>OK, send_date: rrrr-mm-dd hh:mm:ss</string>
</value>
</param>
</params>
</methodResponse>
Values
OK = campaign will be sent, date of delivery
Unsuccessful call response:
JSON
{
"error": "Missing send date of campaign",
"error_status": 1
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>Missing send date of campaign</string>
</value>
</param>
</params>
</methodResponse>
Values
Missing send date of campaign
Missing ID of campaign
The send date is in the past
Invalid ID_delivery_feed
Invalid ID_query
error: Confused parameters - it is not possible to combine delivery capping and delivery feeds
- If a campaign has a mailing list assigned and the mailkit.campaign.single schedule contains delivery feed assignment, the feed will be assigned and mailing lists removed from the campaign.
- If a mailkit.campaign.single schedule call contains valid delivery capping query ID, the query will be assigned to the campaign and delivery capping activated.
- If campaign has delivery capping active and the mailkit.campaign.single schedule is called with ID_query = 0, the delivery capping of the campaign will be disabled. If no ID_query is passed in the call the existing delivery capping settings will be preserved.