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