SpreadWebServcie.CreateCampaign2 Method

 

An advanced method of creating Email campaign.

public int createCampaign2(
 string loginEmail,
 string password,
 string campaignName,
 CampaignCreatives campaignCreatives[],
 string category[],
 int interval, 
 DateTime schedule, 
 string signature, 
 CampaignStatus campaignStatus
 )

Parameters

Parameter

Type

Description

loginEmail

String

Your Spread account.

password

String

API key or password of your Spread account API Key which you can retrieve from your Spread account (My account=> Settings).

campaignName

String

Campaign name will be display in our platform

CampaignCreatives

Creative[]

The array of Creative Creative

category

String[]

The array of contact list name.

interval

Integer

The type of the campaign.

interval=-1Emails are sent for once only.

interval>=0Email will be sent N day(s) after a subscriber subscribed.

schedule

DateTime

Schedule your campaign. recommend datetime string format 'dd MMM yyyy HH:mm:ss' ,such as '22 Feb 2016 12:11:21'

signatureTag

String

Add a tag as your mark, not the signature of this mail

campaignStatus

CampaignStatus

Waiting or Draft ,wait but will not send until schedule

Return Value

Integer Return CampaignID(>0) if success.

Example

	string loginEmail = "spread@reasonables.com";
	string loginPassword = "API KEY";
	string campaignName = "The Name will display in our platform";
	int interval = -1; //-1 send at once or n days later
	DateTime schedule = DateTime.Now;
	string[] category = { "General-VIPME-4", "luohaihao&romeqaz" }; //contact list 
	var campaignStatus = SpreadWS.CampaignStatus.Waiting;

	var creative = new SpreadWS.CampaignCreatives(); //creative is the mail content , define below
	creative.displayName = "ReasonableTech"; //sender name
	creative.fromAddress = "autoedm@reasonable.com";
	creative.subject = "Learn Spread API";
	creative.creativeContent = "Make your own applications with SpreadWS";
	creative.isCampaignDefault = true; //indicate default if there's multi creative
	creative.replyTo = "hoyho@foxmail.com";
	creative.target = "D"; //indicate this campaign is desktop version
	var campaignCreatives = new[] { creative }; //campaignCreatives is array of creative ,if you want to sent more creative in one campaign,set value of campaignCreatives

	var ws = new SpreadWS.Service();
	int campaignId = ws.createCampaign2(loginEmail, loginPassword, campaignName, campaignCreatives, category, interval, schedule, "spread", campaignStatus);
	return campaignId;

See Also

SpreadWebService Class | Spread Web Service Namespace

Campaign Class