SpreadWebServcie.CreateCampaign Method

 

創建一個電子郵件活動和發送.

public int createCampaign (

string loginEmail,

string password,

Campaign campaignArgs,

string[] category,

int interval

)

參數

參數

類型

描述

loginEmail

String

Spread賬號的郵件地址.

password

String

Spread賬號的密碼或者 API Key.

campaignArgs

campaign

要被創建的campaign對象.

category

String[]

這個郵件活動發送到聯系人列表的名稱.

*interval

Integer

郵件活動的類型.

interval=-1, 電子郵件只被發送一次.

interval>=0,電子郵件將在一個用戶訂閱N天后被發送.

返回結果

Integer 被創建活動的ID.

例子

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);

參見

SpreadWebService Class | Spread Web Service Namespace

Campaign Class