Skip to main content

Fetching loyalty points in Emarsys

Let's set up Emarsys to retrieve the loyalty balance of a customer from Talon.One.

To do so, we rely on the Emarsys-specific Get loyalty balance endpoint.

Talon.One requirements

Emarsys requirements

  • You have set up your Emarsys account.
  • You have an active Emarsys campaign for which you want to send emails containing loyalty information.

In this tutorial, we'll use a block-based email campaign.

Creating an API key in Talon.One

In the Campaign Manager, create an Emarsys-specific API key:

  1. In your Talon.One Application, click Settings > Developer settings.

  2. Click Create API Key.

  3. For Do you want to use this API Key with a 3rd party service?, select Yes.

  4. From Platform, select Emarsys.

  5. Select an expiration date, and click Create API Key.

  6. Copy the key for later use.

    note

    You cannot display the API key after this step. If you lose the value, create a new API key.

Creating a connection in Emarsys

To retrieve loyalty ledger information from Talon.One, we call the following endpoint:

POST Get loyalty balance
https://integration.talon.one/emarsys/loyalty_programs/profile/balance

See API Docs

To access this endpoint, create an External Content connection in Emarsys:

  1. Sign in to your Emarsys account.

  2. Open Content > External Content.

  3. Click Create Connection.

  4. In Connection, enter the following details:

    • Name: A descriptive name for the connection.
    • API URL: https://integration.talon.one/emarsys/loyalty_programs/profile/balance?deployment=YOUR_DEPLOYMENT_URL, where YOUR_DEPLOYMENT_URL is the base URL of your Talon.One deployment.
  5. In Authentication, enter the following details:

    1. Method: HTTP basic authentication
    2. User name: ApiKey-v1
    3. Password: The Emarsys-specific API key you created.
  6. In Fields, enter the following details:

    • Reference Fields:

      Field nameValue for testing
      integrationIdA valid Talon.One customer integration ID. Example: URNGV8294NV.
      loyaltyProgramIdThe ID of your profile-based loyalty program in Talon.One. Example: 14.
      subledgerId(Optional) The ID of the subledger from which to retrieve the loyalty balance. If not provided, the loyalty balance is retrieved from the main ledger. Example: my-subledger.
    • Response Fields: The loyalty ledger attributes to retrieve.
      For example, add an activeBalance response field to retrieve the current loyalty point balance of a customer.

  7. To test the connection with the values provided, click Test.

  8. If the test is successful, click Save.

Creating tokens in Emarsys

To use a loyalty attribute in your Emarsys campaign, create a Personalization token:

  1. In Emarsys, open Content > Personalization.
  2. Click Create Token and choose External Content.
  3. In Setup, enter the following details:
    • Name: A descriptive name for the token.
    • (Optional) Category: Create or assign a category. This helps you organize your tokens. The categories are shown in the Personalization sidebar when editing your campaign.
    • External Content preset: Create or assign a preset.
    • Field: The loyalty attribute to use in your Emarsys campaign. For example, to use the current loyalty point balance in your campaign, select activeBalance.
  4. Click Save.

Repeat the above steps for every attribute you want to use in your Emarsys campaign.

Creating an External Content preset

To manage recurring loyalty requests to Talon.One, create an External Content preset and assign it to your Personalization token. See the Emarsys docs.

example

Assume you want to retrieve information about a specific loyalty program in Talon.One. The ID of this program is 14. Also, you want to use the customer's email address as the unique identifier to retrieve loyalty information.

In this case, create the following preset and assign it to your token:

  • Name: A descriptive name for the preset.

  • Connection: The External Content connection you created.

  • Parameters:

    NameTypeValue
    integrationIdContact FieldEmail
    loyaltyProgramIdConstant14

Using loyalty information in an Emarsys campaign

Now that we've established a connection and created a token, we can use the token in a campaign:

  1. Open your Emarsys campaign for editing.
    In this tutorial, we'll use a block-based email campaign.
  2. Go to the Content Creation step of the campaign creation wizard.
  3. In the editor sidebar, open Personalization and find your created tokens in the Custom Tokens section.
  4. Drag the desired tokens into the content editor window.
  5. To test your email, use the Testmail feature.
  6. Click Finish Editing.
note

When using the Inbox Preview feature, placeholders are displayed instead of the actual token values.