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 key或者賬號密碼 API Key API key可在賬號詳情中查看 (我的賬戶=> API).

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 如果成功則返回活動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