确切的目标放大器脚本触发发送没有有效的订阅者

时间:2013-04-02 14:30:09

标签: exacttarget

Ampscript帖子没有返回有效的用户。任何想法?这是一个企业帐户,确切的目标不是很有帮助。我创建了一个api调用并尝试了服务器端js,但返回的响应更差。

%%[

var @emailaddr
SET @emailaddr = 'email@gmail.com'
SET @ts = CreateObject("TriggeredSend")
SET @tsDef = CreateObject("TriggeredSendDefinition")
SET @ts_subkey = 'email@gmail.com'

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)
 ]%%

1 个答案:

答案 0 :(得分:3)

ExactTarget中的企业帐户具有名为“代表您”的子帐户。无论何时将订户添加到帐户或使用TriggeredSend发送电子邮件,都需要传递一个值以指定与其相关的子帐户。使用TriggeredSend,可以通过在订户的属性中设置ChannelMemberID字段来实现。可以在ExactTarget UI中找到子帐户列表,方法是转到Admin选项卡,然后是'Enterprise Management',然后是'Organizational Chart'。

需要添加的代码:

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@gmail.com'
SET @ts = CreateObject("TriggeredSend")
SET @tsDef = CreateObject("TriggeredSendDefinition")
SET @ts_subkey = 'email@gmail.com'

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)
 ]%%

此外,没有必要两次传递Subscriber Key值,因此从示例中删除了以下部分:

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

有关ExactTarget的具体问题,请查看https://code.exacttarget.com/questions/newest

上的Code @ Q& A部分