Skip Navigation Links.
展开 最小化

SpreadWebServcie.AddSubscriberByEmail Method

添加一个单一的订阅者通过他/她的电子邮件.

public bool addSubscriberByEmail (

string loginEmail,

string password,

string subscriberEmail,

string subscription,

DoubleOptIn optInType

)

Public function addSubscriberByEmail( _

loginEmail As String, _

password As String, _

subscriberEmail As String, _

subscription As String, _

optInType As DoubleOptIn _

) As Boolean

No sample for PHP.
No sample.

参数

参数

类型

描述

loginEmail

String

Spread账号的邮箱地址

password

String

Spread账号的密码或者API Key.

subscriberEmail

String

被添加订阅者的邮件地址

subscription

String

添加到目标联系人名单的名称

optInType

DoubleOptIn

Double Opt-in option.

返回结果

HTTP状态码为200,表示添加成功。
true/false表示是否需要联系人确认订阅,参见Double Opt-In

HTTP状态码 返回信息 状态
200 true 添加成功,需要联系人确定订阅
200 false 添加成功,不需要联系人确定订阅
500 Spreader Email and Password not match! 请检查参数loginEmailpassword是否填写错误,无误后检查请求的接口链接(常见问题
500 Subscription "xxxx" does not exist! 联系人名单“xxxx”不存在
500 Please provide a subscriber email. 参数subscriberEmail为空,请填写此参数
500 Email address "123@123" is not valid! 电子邮箱格式错误
500 Fail to add subscriber. 添加联系人失败,请联系技术人员。

例子

string loginName = "spread@reasonables.com";

string loginPassword = "TEST0000-TEST-0000-TEST-0000TEST0000";

string customerEmail = "test@reasonables.com";

string targetSubscription = "NoClone VIP";

DoubleOptIn addOption = DoubleOptIn.Off;

bool confirmIsNeeded;

 

//Create a SpreadWebService object and use its method.

SpreadWebService MySpread = new SpreadWebService();

 

confirmIsNeeded = MySpread.addSubscriberByEmail (loginName, loginPassword, customerEmail, targetSubscription, addOption);

Dim loginName As String = "spread@reasonables.com"

Dim loginPassword As String = "TEST0000-TEST-0000-TEST-0000TEST0000"

Dim customerEmail As String = "test@reasonables.com"

Dim targetSubscription As String = "NoClone VIP"

Dim addOption As DoubleOptIn = DoubleOptIn.Off

Dim confirmIsNeeded As Boolean

 

'Create a SpreadWebService object and use its method.

Dim MySpread As New SpreadWebService

 

confirmIsNeeded = MySpread.addSubscriberByEmail(loginName, loginPassword, customerEmail, targetSubscription, addOption)

/**
* @name     addSubscriberByEmail
* @function ad subscriber email address
* @return
*   'Subscription XXX does not exists!'                        
*   'Email address XXX is not valid!'                          
*   'LoginEmail and Password do not match'                     
*   'False'                                                    
*   'True'                                                     
*/
public function addSubscriberByEmail($loginEmail,$password,$subscriberEmail,$subscription,$optInType){
    $arrayPara = array(
                'loginEmail'      => $loginEmail,
                'password'        => $password,
                'subscriberEmail' => $subscriberEmail,
                'subscription'    => $subscription,
                'optInType'       => $optInType
            );
    $client = new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
    $result = $client->addSubscriberByEmail($arrayPara);
    return $result;
}
        
No sample.