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.