SpreadWebServcie.CreateCampaign2 Method

 

创建群发邮件的高级方法

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

参数

参数

类型

描述

loginEmail

String

你的思齐账号

password

String

API密钥或者密码 API Key 可在平台登陆后我的账户查看(我的账号=> 应用程序接口).

campaignName

String

活动名称会在我们平台显示已供你参考

CampaignCreatives

Creative[]

Creative数组 Creative

category

String[]

联系人列表名称

interval

Integer

活动类型

interval=-1邮件只发生一次(不重复)

interval>=0邮件将在订阅后N天发送

schedule

DateTime

指定定时时间,推荐日期格式 'dd MMM yyyy HH:mm:ss' ,比如 '22 Feb 2016 12:11:21' (活动状态设置为等待)

signatureTag

String

添加本次邮件活动的标记, 注:不是邮件正文的签名

campaignStatus

CampaignStatus

等待或者草稿,等待状态的邮件不会发出去直到定时任务时间到了才发

返回结果

Integer 如果成功则返回大于0的活动ID

例子

	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;

参见

SpreadWebService Class | Spread Web Service Namespace

Campaign Class