Multiple transactions in a message

Sometimes you might need to include multiple transactions in your message. For example, if you are notifying a customer about an upcoming subscription renewal, you might also want to include details of other subscriptions they currently have or a history of their past subscriptions. Or you might want to send an end-of-the-year recap of a customer's hotel bookings. It won't be possible to capture information regarding all the transaction records for a given customer in a single event or a segment. 

You can use Blueshift's 'transaction mixin' feature for these use cases.

How to Set It Up

Step 1: Create a Transaction Mixin   

A regular segment helps you select customers who meet certain criteria. A transaction mixin segment, on the other hand, can help you select transactions that meet certain criteria.

  1.  Go to  'Segments' on the left navigation menu and click on '+SEGMENT'
  2. Select 'Transaction Mixin' as the type of segment you want to create.
      • Additionally, select the type of the transactions you want to include in your message. For example if you want to send a year-end summary of a customer's hotel bookings, you might select the 'Hotel Booking' transaction model
      • Provide a name for the transaction mixin segment
      • Click 'CREATE SEGMENT'
    Create Mixin.png
  3. Define the criteria for the transactions you want to include in your message
      • For example, if you want to send a summary of the customer's hotel reservations for the last year, you might choose to segment on the check_in_timestamp attribute in the transaction model
    Transaction Mixin Criteria.png

Step 2: Create a Message Template

The next step is to create your message where you want to include the details of the transactions you identified in step 1 using a transaction mixin segment. You can do this for any messaging channel by following the steps outlined below:

  1. Go to the 'Data' tab of your template
  2. Under 'Configuration Data', select the transaction mixin you created in step 1
  3. In the template's JSON context (which you can view by clicking on the 'Show data' button next to the preview customer), you will now notice 'transactions' show up. You're now all set to use these transactions in your message using Liquid syntax

Mixins in Template.png

Example: Let's look at an email template where we'd like to include the details of a customer's hotel reservations obtained using the transaction mixin segment in step 1. Let's say we would like to list the hotel's name, which is available in the 'property' attribute of the transaction and the check-in date which is available in the 'check_in_timestamp' attribute of the transaction. The Liquid syntax could look something like the following:

{% for booking in transactions.Hotel_Booking %}
<p>Hotel: {{ }}</p>
<p> Check-in: {{ booking.check_in_timestamp | date: "%b-%d-%Y" }}</p>
{% endfor %}

Step 3: Create and Launch a Campaign

The last step would be to create a campaign. You can choose any campaign type, based on your use case. Just select the template from step 2. And you're all set.

Things to Know

  • You can use multiple transaction mixins in a template, for example a mixin to get a list of 'in_store_orders' and another to get a list of 'online_orders'. When you do so, you will have access to transactions from both the mixins i.e. both 'in_store_orders' and 'online_orders'. In other words, we use the 'OR' logic to combine results across all the transaction mixins used in a template
  • You can use up to 10 mixins in a template and you will have access to up to 300 transactions for any customer in a message
  • If you'd like to enable this functionality for your account, please get in touch with your CSM
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.