SpreadWebServcie.SendTemplateAttachment Method
Send template email with one attachment.
Note: The contact will be automatically added to the contact list named "Auto_ + Current Date".This function allows duplicate sending, so the contact list may contains duplicate email.Do not use this contact list in other campaigns, if you want to avoid duplicate sending.
public
String SendTemplateAttachment
(
string LoginEmail,
string
APIKey,
string
To,
string
TemplateId,
string
Subject,
string
SubstitutionVars,
string
CreativeLanguage
Byte[]
Attachment
string
AttachmentName
)
Parameters
Parameter
|
Type
|
Description
|
LoginEmail
|
String
|
The login email of your Spread account.
|
APIKey
|
String
|
The password of your Spread account API Key which you can retrieve from your Spread account (My account=> Settings).
|
To
|
String
|
The email address of recipient.
|
TemplateId
|
String
|
TemplateId. It is CampaignID.
|
Subject
|
String
|
The subject of the campaign.
|
SubstitutionVars
|
String
|
It is a custom value of Json type, such as : If there is a tag named [CUSTOM] in campaign, then you can send : {"[CUSTOM]":"Value"} .
|
CreativeLanguage
|
String
|
language, such as : en,en-us,zh-tw,zh-cn.
|
Attachment
|
Byte()
|
File Stream of attachment.
|
AttachmentName
|
String
|
file name of attchment in email.
|
Return Value
String Represent the result of send status ."Sent success" means success,others fail
Example
string
LoginEmail =
"spread@reasonables.com"
;
string
APIKey =
"spread"
;
//Define recipient email
string
To =
"noclone@reasonables.com"
;
//Content Information
string
TemplateId =
"1"
;
string
Subject =
"Title"
;
string
SubstitutionVars =
"{\"[CUSTOM]\":\"Value\"}"
;
//Language Information
string
CreativeLanguage =
"en"
;
//Attachment Information
byte[]
Attachment =
File
.ReadAllBytes(
"xxxx/1234.txt"
);
string
AttachmentName =
"1234.txt"
;
//Create a SpreadWebService object and use its method.
SpreadWebService
MySpread =
new
SpreadWebService
();
string
result = MySpread.SendTemplateAttachment(LoginEmail,APIKey,To,TemplateId,
Subject,SubstitutionVars,CreativeLanguage,Attachment,AttachmentName);
See Also
SpreadWebService
Class | Spread Web Service Namespace
Campaign
Class