徽标 Help Portal
  • 现在开始

    Introduction

    • Onboarding overview
    • Project Initiation
    • Email compliance
    • 帐户管理

    数据

    • Data Exchange
    • 数据登入
    • Web data collection
    • 整合

    Channels

    • Email onboarding
    • Smart Insight
    • Predict
  • 培训视频

    Resources

    • Introduction
    • Online Self-learning
    • Onboarding Videos

    Events

    • Instructor-led Training
    • Webinars
    • Seminars
    • Training Calendar
  • 用户指引

    策略

    • 个性化
    • 自动
    • Data Monitoring

    Channels

    • 电子邮件
    • 移动端 Apps
    • Web
    • Ads
    • SMS

    Add-ons

    • Smart Insight
    • Predict
    • 优惠信息推荐
    • AIM
    • Relational Data
  • 支持文档
    Forrester Wave CCCM (Independent Platforms) Report Q4 2019

    新消息

    • Emarsys 平台有哪些新增功能?
    • Updates from the CSA
    • 试验功能
    • 关于数据保护和 GDPR 的文章

    Support

    • 如何获得帮助?
    • 编辑用户配置
    • Preparing for Black Friday 2019
    • Black Friday 2019 - Best practices
  • |
  • Partners

    Enhance Partners

    • Getting Started as an Emarsys Partner
    • The Emarsys Integration Platform
    • Automation Center Integrations
  • 开发人员
  • 系统情况
需要协助?
简体中文 Deutsch English Español Français Русский Türkçe Test New Chat
登录
  • 电子邮件
  • Triggered Email
  • 0 电子邮件 Triggered Email

In this section:

  • Overview:: Triggered Email - Overview
  • End-user guides:: Triggered Email - End-user guide
  • Use cases and examples:: Triggered Email - Use cases and examples
  • End-user guides:: Triggering external data for transactional emails
  • Overview:: Transactional opt-in
EDIT
Expand all

End-user guides:: Triggering external data for transactional emails

Updated: 2019年11月14日 01:00
360025468354
End-user guides:: Triggering external data for transactional emails

If you want to create transactional emails in Visual Content Editor, you need to have the following:

  • a JSON to trigger the API
  • an HTML snippet which you want to personalize with the data

JSON

{
  "key_id": "3",
  "external_id": "test@example.com"
  "data": {
    "orderId": 1234,
    "orderItems": [
      {
        "productCode": 12,
        "imageUrl": "http://domain.com/12.jpg"
      },
      {
        "productCode": 13,
        "imageUrl": "http://domain.com/13.jpg"
      }
    ]
  }
}

With the above JSON example, order 1234, its related products 12 and 13 and their images will be available for the email campaign. The data displayed in the email itself will be gathered from here. You can include any number of items.

You have the possibility to test your JSON on the API Demo page. You need to put the data part of your JSON into the text field of data and define the remaining parameters.

You can check how the Triggering an External Event API endpoint works here.

HTML snippet

To create your HTML code, you must reference your external data with this syntax:

{{ event.variableName }}

An example for the HTML code is the following:

<h1>Order ID: {{event.orderId}}</h1>
<ul>
{% foreach order in event.orderItems %}
  <li>
    {{order.productCode}}
    <img src="{{order.imageURL}}" />
  </li>
{% endforeach %}
</ul>

With the help of the above HTML snippet, a header which contains the order ID becomes displayed in the transactional email. The code contains the foreach tag which loops through all product codes and image URLs provided in the JSON. It means that the email will list all product codes and image URLs it could reach.

Please note that for foreach there is a limit, which is 100 items.

The very last step is to finalize your campaign and activate it in Automation Center or use as a simple external event triggered message.

这篇文章有帮助吗?

还有其它问题?提交请求
返回页首

Emarsys is a Leader

You may also be interested in:

相关文章

  • Use cases and examples:: Triggered Email - Use cases and examples
  • Overview:: Triggered Email - Overview
  • End-user guides:: Triggered Email - End-user guide
  • Overview:: Transactional opt-in
  • List of all public API endpoints
Copyright © 2019 Emarsys eMarketing Systems. All rights reserved
Legal Notice Privacy Policy Master Services Agreement Anti-spam Policy