Simple Email Marketing
Home > Resource Center > Guide to Automation > Trigger events: custom API event

Trigger events: custom API event

Table of contents
No headers

 

Access to the Event API is available only to Emma Plus, Premium and Enterprise customers.


There are five available trigger types when using automation: signupdate-basedfield changelink click, and custom API event.

A workflow setup with a custom API event can be triggered by events that are shared with Emma from other platforms using Emma’s Event API.

You can filter your trigger event using up to 5 attributes (criteria) of the event that you’ve shared via the event API (e.g. event-name equals “purchase-completed” and the order-amount is greater than “100"). 


You can use the operators below to filter your trigger event. Numeric operators will not work with text values.

  • Equals
  • Does not equal
  • Contains
  • Does not contain
  • Greater than
  • Greater than or equal to
  • Less than
  • Less than or equal to

You can choose how often your contacts should be allowed to enter a workflow. “Send once” is a good option for one-time messages that should not be re-sent in response to future events. “Send every time” is a good option for messages that should always be triggered in response to an event. Only contacts who are currently in “active” status within your audience can be entered into event-powered workflows.

What can and cannot be used to trigger and filter automated workflows.

The following snippet is a simplified sample of an event that might be shared with Emma using the Event API. Note that the information contained within the order is stored in key/value pairs.

 

{

  “event_name”: “order-completed”

    "id": 1028374857,

    "email": “cody.devos@myemma.com”,

    "closed_at": null,

    "created_at": "2016-04-12T11:00:00-09:00",

"total_price": “145.53”,

      "total_discounts": “14.70",

      "order_number": 1001,

    "discount_codes": [

      {

        "code": “TEN16”,

        "amount": “10.00",

        "type": "percentage"

      }

    ],

   "line_items": [

      {

        "id": 998327818,

        "variant_id": 59284621,

        "title": “Slim Short Sleeve Linen Shirt”,

        "quantity": 1,

        "price": “68.00",

        "sku": “SLSSLNSHRT”,

        "variant_title": “white”,

        “size”: medium,

        "product_id": 632910392,

        "requires_shipping": true,

        "taxable": true,

        "gift_card": false,

        "name": “Slim Short Sleeve Linen Shirt - White“,

                ],

        "tax_lines": [

          {

            "title": "State Tax",

            "price": “6.12”,

            "rate": 0.09

          }

{

        "id": 789327523,

        "variant_id": 89137513,

        "title": “Slim Mens Chino”,

        "quantity": 1,

        "price": “79.00",

        "sku": “SLMNCHNO”,

        "variant_title": “green”,

        “size”: 32W32L,

        "product_id": 948517351,

        "requires_shipping": true,

        "taxable": true,

        "gift_card": false,

        "name": “Slim Short Sleeve Linen Shirt - White“,

                ],

        "tax_lines": [

          {

            "title": "State Tax",

            "price": “7.11”,

            "rate": 0.09

          }

        ]

      },

  "shipping_lines": [

      {

        "id": 0928273492,

        "title": "Free Shipping",

        "price": "0.00",

        "code": "Free Shipping",

        "source": "shopify",

        "phone": null,

        "carrier_identifier": null,

        "tax_lines": [

        ]

      }

    ],

 

​For example, the key “event_name” contains the value “order-completed.” Top-level key/value pairs like this can be used to power automated workflows. 

However, you’ll also see that, in addition to simple key/value pairs like “event_name,” “total_price” and “email,” there are keys that include much more than a single value. For example, “line_items” not only includes the names and IDs of the two products purchased in this order, it also contains detailed information about their price, size and other attributes. The “line_items” key is therefore said to contain “nested” attributes - and the individual items within the “line_items” section contain nested attributes of their own (for the information in the “tax_lines” section).

Workflows cannot currently be triggered or filtered based on data contained in nested attributes.

You must to post a comment.
Last modified

Tags

Classifications

This page has no classifications.