2013-04-02 16 views
0

Ampscript post返回無效用戶。任何想法?這是一個企業帳戶,確切的目標不是很有幫助。我創建了api調用並嘗試了服務器端js,但返回的響應甚至更糟。精確的目標Amp腳本觸發發送沒有有效的訂戶

%%[ 

var @emailaddr 
SET @emailaddr = '[email protected]' 
SET @ts = CreateObject("TriggeredSend") 
SET @tsDef = CreateObject("TriggeredSendDefinition") 
SET @ts_subkey = '[email protected]' 

SetObjectProperty(@tsDef, "CustomerKey", "ET_Support_LS") 
SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef) 

SET @ts_sub = CreateObject("Subscriber") 
SetObjectProperty(@ts_sub, "EmailAddress", @emailaddr) 
SetObjectProperty(@ts_sub, "SubscriberKey", @ts_subkey) 

SET @ts_attr = CreateObject("Attribute") 
SetObjectProperty(@ts_attr, "Name", "Subscriber Key") 
SetObjectProperty(@ts_attr, "Value", @ts_subkey) 
AddObjectArrayItem(@ts_sub, "Attributes", @ts_attr) 

AddObjectArrayItem(@ts, "Subscribers", @ts_sub) 
SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode) 
]%% 

回答

3

ExactTarget中的企業帳戶具有名爲「您代表」帳戶的子帳戶。無論何時,用戶被添加到帳戶或使用TriggeredSend發送電子郵件時,都需要傳遞一個值來指定他們與哪個子帳戶相關。對於TriggeredSend,可以通過在用戶的屬性中設置ChannelMemberID字段來完成此操作。在ExactTarget用戶界面中,您可以進入管理標籤,然後選擇「企業管理」和「組織結構圖」,找到子帳戶列表。要添加需要

代碼:

SET @attr = CreateObject("Attribute") 
SetObjectProperty(@attr, "Name", "ChannelMemberID") 
SetObjectProperty(@attr, "Value", "PUT THE NUMERIC VALUE FOR AN OYB ACCOUNT HERE") 
AddObjectArrayItem(@ts_sub, "Attributes", @attr) 

全部實施例: %% [

var @emailaddr 
SET @emailaddr = '[email protected]' 
SET @ts = CreateObject("TriggeredSend") 
SET @tsDef = CreateObject("TriggeredSendDefinition") 
SET @ts_subkey = '[email protected]' 

SetObjectProperty(@tsDef, "CustomerKey", "ET_Support_LS") 
SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef) 

SET @ts_sub = CreateObject("Subscriber") 
SetObjectProperty(@ts_sub, "EmailAddress", @emailaddr) 
SetObjectProperty(@ts_sub, "SubscriberKey", @ts_subkey) 

SET @attr = CreateObject("Attribute") 
SetObjectProperty(@attr, "Name", "ChannelMemberID") 
SetObjectProperty(@attr, "Value", "PUT THE NUMERIC VALUE FOR AN OYB ACCOUNT HERE") 
AddObjectArrayItem(@ts_sub, "Attributes", @attr) 

AddObjectArrayItem(@ts, "Subscribers", @ts_sub) 
SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode) 
]%% 

而且,沒有必要通過兩次的用戶密鑰值,因此下面的部分從示例中刪除:

SET @ts_attr = CreateObject("Attribute") 
SetObjectProperty(@ts_attr, "Name", "Subscriber Key") 
SetObjectProperty(@ts_attr, "Value", @ts_subkey) 
AddObjectArrayItem(@ts_sub, "Attributes", @ts_attr) 

For ExactTarget specific questi請檢查Code @ Q & A科https://code.exacttarget.com/questions/newest