SpreadWebServcie.CreateCampaign Method

 

It creates an email campaign and sends it out.

public int createCampaign (

string loginEmail,

string password,

Campaign campaignArgs,

string[] category,

int interval

)

Parameters

Parameter

Type

Description

loginEmail

String

The login email of your Spread account.

password

String

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

campaignArgs

campaign

The campaign to be created.

category

String[]

The names of target subscriptions the campaign sent to.

*interval

Integer

The type of the campaign.

interval=-1, emails are sent for once only.

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

Return Value

Integer of the ID of the created campaign.

Example

string loginName = "spread@reasonables.com";

string loginPassword = "spread";

 

//Create an array of target subscriptions

string[] targetSubscriptions = new string[2];

targetSubscriptions[1] = "NoClone VIP";

targetSubscriptions[2] = "Spread VIP";

 

int interval = -1;

int campaignID;

 

//Create a Campaign object

Campaign myCampaign = new Campaign();
myCampaign.campaignName
= "NoClone Promotion";

myCampaign.from = "NoClone";

myCampaign.fromEmail = "noclone@reasonables.com";

myCampaign.subject = "NoClone 4 is released!";

myCampaign.content = "Download NoClone 4 at http://noclone.net now!";

// suggest dateTime string format "dd MMM yyyy HH:mm:ss" ,such as "22 Feb 2013 12:11:21" .
myCampaign.schedule = "22 Feb 2013 12:11:21";

 

//Create a SpreadWebService object and use its method.

SpreadWebService MySpread = new SpreadWebService();

 

campaignID = MySpread.createCampaign (loginName, loginPassword, myCampaign, targetSubscriptions, interval);

See Also

SpreadWebService Class | Spread Web Service Namespace

Campaign Class