Creating a new campaign

Controller is used for creating, checking and sending a campaign.

Recall:

POST /rest/campaigns/create

 

Data in POST:

name Required Campaign name
url Optional Website address from which the HTML code is to be downloaded
html Required*  Email html content (required if there is no text nor url address).
text Required* Email text content (required if there is no html content).
subject Optional Subject of email to be sent by the system. In case of no such subject, name of the campaign will be taken.
from_address Optional "From" field. If empty, a default sender's address will be filled in.
from_name Optional "Sender's name" field. If empty, a default sender's name will be filled in.
reply_to Optional "Reply to" field. If empty, a default sender's address will be filled in
list Required * Hash of subscriber list to which the campaign is to be sent. It can be a table with hashes in case of sending to several lists. In case of sending to a group, there is no need to define a list.
group Required * Hash of group to which the campaign is to be sent. It can be a table with hashes in case of sending to several groups. In case of sending to a list, there is no need to define a group.
resignlink Optional An URL address to which the subscriber will be redirected after clicking on the resignation link.

 

Returned data:

hash In case of proper creation of a campaign, the hash will be returned.

 

Error codes:

1701 Campaign has no name
1702 No content (no text, html nor url was defined)
1703 Incorrect url address
1704 No client (internal error)
1705 1705 No parameters (internal error)
1706 Incorrect sender's address (from_address)
1707 Incorrect "reply to” address
1708 No subscriber list nor group
1709 At least one incorrect list hash.
1710 At least one incorrect group hash.
1711 No list with defined hash found.
1712 No group with defined hash found.
1713 Resignation link should be a correct URL address.