如何使用 Exact Target 中现有的电子邮件模板发送电子邮件?
我在 ExactTarget 中创建了一个简单的电子邮件模板,其 ID 为 19712732。
我想使用此电子邮件模板通过 Exact Target 的 WebService API(C# 代码)发送电子邮件:https://webservice.exacttarget.com/Service.asmx?
维基文档在这里: http://wiki.memberlandingpages.com/
这怎么可能?我浏览了文档,但尚未找到任何相关内容。
另外,我希望能够使用 API 设置电子邮件模板的一些内容。例如,也许我可以添加像 {CustomHtml1} 这样的键/属性,然后在我的 C# 代码中设置该键/属性的值?
谢谢,
I have created a simple Email Template in ExactTarget which has an ID e.g. 19712732.
I'd like to use this email template to send emails using the WebService API (C# code) of Exact Target: https://webservice.exacttarget.com/Service.asmx?
The wiki documentation is here: http://wiki.memberlandingpages.com/
How would that be possible? I went through the docs but couldn't find anything relevant yet.
Also, I'd like to be able to set some contents of the Email Template using the API. For example, perhaps I can add a key/property like {CustomHtml1} then set the value of this key/property in my C# code?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
克里斯是对的,您将需要结合使用数据扩展和触发发送。
概括地说,您需要执行以下操作:
CustomHTML1
字段)。为了传入自定义数据(例如
CustomHTML1
),您需要将该名称/值对添加为 API 调用中的订阅者属性:以上代码应添加到链接的适当的代码示例,它仅提供特定于设置自定义属性的信息。
据我所知,没有任何参考资料可以阐明这个过程,但我发现它是最有效的。
(还值得注意的是,所有 API 文章最近都已移至 code.exacttarget.com,因此 wiki 将受到一定程度的限制在这种情况下使用)
祝你好运!
编辑:我还想澄清一下,上述任何通过 UI 调用配置的步骤都可以通过 API 完成。但是,由于它们是一次性配置元素,因此通常只需登录一次、进行设置并将 API 开发工作集中在实际电子邮件发送上会更容易。
编辑:为了完整起见,应该注意的是,没有必要为此目的使用数据扩展。从技术上讲,订阅者上有一个属性可以实现相同的目的,如果存在数据扩展不起作用的情况,这可能是更好的选择。
在这种情况下,如果可能的话,我会推荐 DE 路由,因为它在物理上将发送特定的数据与订阅者本身分开。这样,可能仅与特定发送相关的信息不会“永久”存储在订阅者上。
Chris is right, you will want to utilize a combination of Data Extensions and Triggered Sends.
On a high level, this is what you will want to do:
CustomHTML1
field)In order to pass in the custom data (e.g.
CustomHTML1
), you will want to add that name/value pair as a Subscriber attribute in the API call:The above code should be added in to to the linked code sample as appropriate, it is there only to provide information specific to setting up the custom attribute.
As far as I know, there aren't any single references that spell out this process, however I have found it to be the most effective.
(Also of note, all of the API articles have recently been moved to code.exacttarget.com, so the wiki is going to be somewhat limited use in this situation)
Good luck!
EDIT: I wanted to also clarify that any steps above that call for configuration via the UI can also be done through the API. However, since they are one-time configuration elements, it is typically easier to just log in once, set it up, and focus API development efforts on the actual email sends.
EDIT: For the sake of completeness, it should be noted that it is not necessary to use Data Extensions for this purpose. It is technically possible to have an attribute on the subscriber which serves the same purpose and, if there are situations where Data Extensions won't work, this may be the better option.
I would recommend the DE route if at all possible in this case because it physically separates send-specific data from the subscriber itself. That way, information that may only be relevant for the specific send is not "permanently" stored on the Subscriber.
我发现 Razor 引擎退出很方便做这样的事情,请查看 http://kazimanzurrashid.com/posts/use-razor-for-email-template-outside-asp-dot-net-mvc
I found Razor engine quit convenient to do such things, please look at http://kazimanzurrashid.com/posts/use-razor-for-email-template-outside-asp-dot-net-mvc
我认为您正在寻找的东西称为数据扩展。
以下链接似乎显示了如何执行此操作;但我之前从未使用过它们,所以不能 100% 相信这一点。
http://docs.code.exacttarget.com/020_Web_Service_Guide/Technical_Articles/Creating_an_Email_Send_Definition_with_Dynamic_Content_Using_the_Web_Service_API
另请查看:http://docs.code.exacttarget.com/020_Web_Service_Guide/Simple_Development_Scenarios/Send_an_Email_to_a_Data_Extension_using_an_Email_Send_Definition
I think what you are looking for is called Data Extensions.
The following link seems to show how to do this; but having never used them before I'm not 100% on that.
http://docs.code.exacttarget.com/020_Web_Service_Guide/Technical_Articles/Creating_an_Email_Send_Definition_with_Dynamic_Content_Using_the_Web_Service_API
Also review this: http://docs.code.exacttarget.com/020_Web_Service_Guide/Simple_Development_Scenarios/Send_an_Email_to_a_Data_Extension_using_an_Email_Send_Definition
我很确定您一定看过这个。然而,由于它没有建议任何有关模板的内容,我也会尝试查看 this (在“基于模板创建电子邮件”末尾)和 this 并使用
reflectorFiddler (抱歉混淆了我能说什么!)看看他们正在触发哪些网络服务调用。我的猜测是,有一封电子邮件和模板并没有真正相关。客户端(默认情况下是 Web 客户端)负责通过查看模板来创建电子邮件正文(该模板可能需要调用其他一些 Web 服务来获取)
I am pretty sure you must have looked at this. However since it does not suggest anything regarding templates, I would also try to look at this (at the end "Create an Email Based on a Template") and this and use
reflectorFiddler (sorry got mixed up ! what can I say !) to see what web-service calls are they firing.My guess is that there is a email and templates are not really related. It is the client's (in default case, the web client's) responsibility to create the body of the email by looking at the template (which in turn might have some other web service call to get)