This method allows you to create, send or schedule a campaign.
Important note: You must have a cron job setup for sending in order for your campaign to be sent or scheduled via this API. The cron job setup instructions can be found at the 'Define recipients' page (the page where you choose lists to send your campaign to) in a yellow box at the bottom.
URL
https://mailcup.net/api/campaigns/create
PARAMETERS (POST)
api_key your API key, available in Settings.from_name the 'From name' of your campaignfrom_email the 'From email' of your campaignreply_to the 'Reply to' of your campaigntitle the 'Title' of your campaignsubject the 'Subject' of your campaignplain_text the 'Plain text version' of your campaign (optional)html_text the 'HTML version' of your campaignlist_ids Required only if you set send_campaign to 1 and no segment_ids are passed in. List IDs should be single or comma-separated. The encrypted & hashed ids can be found under View all lists section named ID.segment_ids Required only if you set send_campaign to 1 and no list_ids are passed in. Segment IDs should be single or comma-separated. Segment ids can be found in the segments setup page.exclude_list_ids Lists to exclude from your campaign. List IDs should be single or comma-separated. The encrypted & hashed ids can be found under View all lists section named ID. (optional)exclude_segments_ids Segments to exclude from your campaign. Segment IDs should be single or comma-separated. Segment ids can be found in the segments setup page. (optional)brand_id Required only if you are creating a 'Draft' campaign (send_campaign set to 0 or left as default). Brand IDs can be found under 'Brands' page named IDquery_string eg. Google Analytics tags (optional)track_opens Set to 0 to disable, 1 to enable and 2 for anonymous opens tracking.track_clicks Set to 0 to disable, 1 to enable and 2 for anonymous clicks tracking.send_campaign Set to 1 if you want to send the campaign as well and not just create a draft. Default is 0.schedule_date_time Campaign will be scheduled if a valid date/time is passed. Date/time format eg. June 15, 2021 6:05pm. The minutes part of the time has to be in increments of 5, eg. 6pm, 6:05pm, 6:10pm, 6:15pm.schedule_timezone Eg. 'America/New_York'. See the list of PHP's supported timezones. This parameter only applies if you're scheduling your campaign with schedule_date_time parameter. MailCup will use your default timezone if this parameter is empty.RESPONSE (Plain text)
Success: Campaign created
Success: Campaign created and now sending
Success: Campaign scheduled
Error: No data passed
Error: API key not passed
Error: Invalid API key
Error: From name not passed
Error: From email not passed
Error: Reply to email not passed
Error: Subject not passed
Error: HTML not passed
Error: List or segment ID(s) not passed
Error: One or more list IDs are invalid
Error: One or more segment IDs are invalid
Error: List or segment IDs does not belong to a single brand
Error: Brand ID not passed
Error: Unable to create campaign
Error: Unable to create and send campaign
Error: Unable to schedule campaign
Error: Unable to calculate totals
We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from. By clicking on the button you accept our cookie policy.
