Brickworks loyalty template with tiered offer

Published December 29, 2025
Modules
Difficulty

Delivering personalized and context-aware communication often requires combining behavioral insights with dynamically evaluated logic.

Brickworks allows you to define a communication template that can dynamically assign the most relevant loyalty offer for each customer based on their browsing behavior.

In this use case, you will create a schema that enables an email template to return a specific loyalty offer based on an evaluated expression. This supports a next best offer (NBO) approach, where each customer receives the most relevant promotion determined by their behavior. The expression analyzes the price range of the products they viewed and assigns them to one of three predefined tiers. Based on the tier result, customers can automatically receive an email containing the loyalty offer that best matches their browsing behavior.

Email message example

Prerequisites


Process


In this use case, you will go through the following steps:

  1. Create an aggregate that will return last visited product price.
  2. Create segmentations of customers qualifying for one of the three offer tiers.
  3. Create an expression that returns information on tier which the customer qualifies for.
  4. Create a schema with offer based on the expression result.
  5. Create records.
  6. Create an email campaign based on the brickworks schema, using our predefined email template.

Create an aggregate


In this step, create an aggregate that returns the price of the last visited product. The result of the aggregate will be used in segmentations determining tiers in the offer.

  1. Go to Analytics icon Analytics > Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter the name of the aggregate.
  4. Click Analyze profiles by and select Last.
  5. From the Choose event dropdown list, select the page.visit event.
  6. As the event parameter, select price.
  7. Click the + where button.
  8. From the Choose parameter dropdown list, select price once again.
  9. From the Choose dropdown list, select String and the Is not empty operator.
  10. Set the period from which the aggregate will analyze the results, in our case Last 30 days.
  11. Save the aggregate.
The view of the aggregate configuration
Aggregate that returns the price of the last visited product configuration

Create segmentations


Based on the aggregate created in the previous step, create three segmentations of customers qualifying for one of the three next best offer tiers - Low Cost, Advantage, or All Inclusive.

Low cost tier segmentation

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.
  2. Enter the name of the segmentation.
  3. Click Add condition.
  4. Select the aggregate created in the previous step.
  5. From the Choose dropdown list, select Number and the Less or equal to operator.
  6. In the text field, enter 300 as the upper limit of this tier.
  7. Click Save.
The view of the segmentation configuration
Segmentation that returns customers meeting the conditions of the low cost tier

Advantage tier segmentation

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.
  2. Enter the name of the segmentation.
  3. Click Add condition.
  4. Select the aggregate created in the previous step.
  5. From the Choose dropdown list, select Number and the Less than operator.
  6. In the text field, enter 700 as the upper limit of this tier.
  7. Click Add condition.
  8. Select the aggregate created in the previous step.
  9. From the Choose dropdown list, select Number and the More than operator.
  10. In the text field, enter 300 as the lower limit of this tier.
  11. Click Save.
The view of the segmentation configuration
Segmentation that returns customers meeting the conditions of the advantage tier

All inclusive tier segmentation

  1. Go to Analytics icon Analytics > Segmentations > New segmentation.
  2. Enter the name of the segmentation.
  3. Click Add condition.
  4. Select the aggregate created in the previous step.
  5. From the Choose dropdown list, select Number and the More or equal to operator.
  6. In the text field, enter 700 as the upper limit of this tier.
  7. Click Save.
The view of the segmentation configuration
Segmentation that returns customers meeting the conditions of the all inclusive tier

Create an expression


In this step, create an attribute expression that evaluates the customer’s last visited product price and assigns it to the appropriate offer segment. The expression checks whether the profile meets the criteria for the Low Cost, Advantage, or All Inclusive NBO segmentation categories and returns the corresponding offer label. This expression will be later used in the schema.

  1. Go to Image presents the Analytics icon Analytics > Expressions > New expression.
  2. Enter the name of the expression.
  3. Set the Expression for option to Atribute.
  4. Click Select and from the Function dropdown list, choose To string.
  5. Click Select in the brackets, and from the Function dropdown list, choose If.
  6. Click the first Select in the brackets, and pick Profile.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and click Choose attribute.
    3. From the dropdown list, select the low cost tier segmentation you created earlier.
  7. Click the second Select in the brackets, and pick Constant.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and type Low Cost Offer in the field.
  8. Click the third Select in the brackets, and from the Function dropdown list, choose If.
  9. Click the first Select in the brackets, and pick Profile.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and click Choose attribute.
    3. From the dropdown list, select the advantage tier segmentation you created earlier.
  10. Click the second Select in the brackets, and pick Constant.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and type Advantage in the field.
  11. Click the third Select in the brackets, and from the Function dropdown list, choose If.
  12. Click the first Select in the brackets, and pick Profile.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and click Choose attribute.
    3. From the dropdown list, select the all inclusive tier segmentation you created earlier.
  13. Click the second Select in the brackets, and pick Constant.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and type All inclusive in the field.
  14. Click the thirds Select in the brackets, and pick Constant.
    1. Click the 0 node that appeared on the canvas.
    2. Scroll down the page and type null in the field.
  15. Click Save.
The view of the expression configuration
Expression that returns information on tier which the customer qualifies for.

Create a schema


In this section, you will configure a Brickworks schema with fields for offer information.

  1. Go to Data Management icon Data Management > Schemas > New schema.
  2. Choose Simple Schema.
  3. In Display name, enter a name for the schema, for example Telco offers. API names value is pre-filled with the value from Display name. The value in this field is the unique identifier used to reference this schema in API requests.
  4. Optionally, add the Description.

Add the Offer title

  1. Click Add new field and choose String.
  2. Complete the fileds:
    • Add the Display name for the field in our case Offer title.
    • The API name will be pre-filled automatically.
    • Description is optional, in our case Presents offer title to be displayed for customer.
  3. In Settings, select Use as record title.
  4. Click Apply to save your changes.
The view of the brickworks configuration
Schema configuration

Add the Offer image

  1. Click Add new field and choose Image.
  2. Complete the fileds:
    • Add the Display name for the field in our case Offer image.
    • The API name will be pre-filled automatically.
    • Description is optional, in our case image of the offer.
  3. To save your changes, Click Apply.

Add other descriptive fields

  1. Click Add new field and choose String.
  2. Complete the fileds:
    • Add the Display name for the field.
    • The API name will be pre-filled automatically.
    • Description is optional.
  3. To save your changes, click Apply.

In this use case, we add the following String fields:

  • Offer short description - describes the purpose of the offer,
  • Package conditions - minutes, internet packages description,
  • Promotion for new subscribers - new subscribers only - promotion information.

Add the Price

  1. Click Add new field and choose Number.
  2. Choose Float to let users type real numbers, also numbers which contain fractional or decimal parts.
  3. Complete the fileds:
    • Add the Display name for the field in our case Price.
    • The API name will be pre-filled automatically.
    • Description is optional, in our case monthly price for offer in Euro.
  4. To save your changes, click Apply.

Add the Number of months

  1. Click Add new field and choose Number
  2. Choose Integer to let users type in a whole number that can be positive, negative, or zero, but does not include any fractional or decimal part.
  3. Complete the fileds:
    • Add the Display name for the field in our case number of months. the API name will be pre-filled automatically. Description is optional, in our case Number of contracted months. -1 equals that the offer has no contract engagement.
  4. In Settings, check Dafault value and type -1
  5. To save your changes, click Apply.
The view of the brickworks configuration
Brickworks configuration

Add the Expression

  1. Click Add new field and choose Expression.
  2. Complete the fileds:
    • Add the Display name for the field in our case qualified offer.
    • The API name will be pre-filled automatically.
    • Description is optional, in our case informs about offer which qualifies for client.
  3. Choose the expression created in the previous part of the process from the list.
  4. To save your changes, click Apply.

Add the Jinjava code

  1. Click Add new field and choose Jinjava code
  2. Complete the fileds:
    • Add the Display name for the field in our case display offer.
    • The API name will be pre-filled automatically.
    • Description is optional, in our case informs if offer should be displayed.
  3. Use jinjava code:
    {% if record.offerTitle == record.qualifiedOffer %}true{% else %}false{% endif %}
  4. To save your changes, click Apply.

Set up the Audience & Settings

  1. Click the Audience & Settings tab.
  2. In the Audience section, click Define.
  3. Choose the schema recipients according to your needs, in our case choose Everyone.
  4. Click Apply.
  5. In the upper-right corner, click Save

Create records


Creating a record means adding the data to the schema. It means that you fill out schema fields. In this case, these are examples of telecommunications offers - one of the three next best offer tiers - Low Cost, Advantage, or All Inclusive.

  1. Go to Data Management icon Data Management > Data collections > Select schema.
  2. Choose schema created in the previous step.
  3. In the upper-right corner, click New record. We will create three records in total, for each of the tiers.
  4. Add a name for the record.
  5. Add a slug for the record. Slug is a unique, URL-friendly version of the name. It usually contains only lowercase letters, numbers, and hyphens.
  6. Add Offer title.
  7. Add coresponding Offer image, Offer short description, Package conditions, Price, Number of months, Promotion for new subscribers.
  8. Everything in Qualified offer section shouold be pre-filled with data provided in the schema.
  9. In the upper-right corner, click Publish to publish your record.
  10. Repeat steps 3-9 for two remaining tiers.

Previewing records

After saving the record either as a draft (in case of records created based on versioned schemas) or publishing it (in case of both schema types), you can preview the record for the context of a selected user. This context-driven approach enables your records to adapt dynamically based on the requesting application, user session, or any external factors you define.

  1. In Data Management icon Data Management > Data collections.

  2. In the header, from Select schema dropdown list, select the schema created in the previous step.

  3. Find the record which you want to preview.

  4. Enter the record configuration.

  5. Click Preview.

  6. Click Preview contexts.

  7. From the dropdown list, find a profile for which you want to generate record preview. This means the same record can render completely differently depending on the context you provide.

    The view of the record results for an example profile
    Record results for an example profile
  8. You can also see the preview as JSON.

The view of the JSON record results for an example profile
JSON record results for an example profile

Create an email campaign


In this part of the process, you create an email campaign. We will use a predefined template, so there is no need to create a template from scratch.

  1. Go to Image presents the Communication icon Communication > Email campaign > Create new.
  2. Enter the name of the email campaign.
  3. In the Audience section, define the recipents of your campaign according to your business needs.

Define content


In this part of the process, you will create the content of the email message that returns information on tier which the customer qualifies for, with the help of ready-made template.

  1. Click Define in the Content section.
  2. From the dropdown in the From email address section, select the email account from which the email will be sent.
  3. In Subject, provide the subject of the email.
  4. Click Create message and from the list of template folders, select Predefined templates.
  5. Select the Brickworks: Telco offer template.

Result: You are redirected to the code editor.

Note: You can edit the template in two ways, by editing the code of the template add snippets, add variables and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.

Edit form in the Config tab


The form in the Config tab is already filled in with default values. You can keep them or change them to fit your business needs.

The view of the email template configuration
Email template configuration
  1. To the Schema ID field, add the ID of the schema created in the previous part of the process.
  2. To the following fields, add the ID of the records created in the previous part of the process. You can find the ID of the record in the record URL:
    • Record ID - Low cost offer,
    • Record ID - All inclusive,
    • Record ID - Advantage fields**,
  3. Optionally, you can edit the copy and design of the template.
  4. After you make changes to the template, you can check the preview.
    1. Click the Preview button on the upper left side.
    2. Enter the ID of a customer.
    3. Click Apply.
  5. If the template is ready, in the upper right corner click Save as….
  6. On the pop-up:
    1. In the Template name field, enter the name of the template.
    2. From the Template directory dropdown list, select the folder where the template will be saved.
    3. Confirm by clicking Save.
  7. To continue the process of configuring the email campaign, click Next.
  8. To save your content changes, click Apply.

Prepare the final settings

  1. In the Schedule tab, decide when your email is sent.
  2. Optionally:
    1. In the UTM & URL parameters section, add the parameters to track the email performance.
    2. In the Additional parameters section, add the custom event parameters with constant values to the automatically generated events in the email channel.
    3. In the Test section, you can send a test email of your message to verify if the content of the email is displayed correctly.
  3. If everything is ready, click Send.

What’s next


After defining this schema, you can reuse the template across other placements as needed. It can be applied in emails, in-apps, or any additional surfaces supported by your setup.

Check the use case set up on the Synerise Demo workspace


In Synerise Demo workspace, you can check the configuration of:

If you’re our partner or client, you already have automatic access to the Synerise Demo workspace (1590), where you can explore all the configured elements of this use case and copy them to your workspace.

If you’re not a partner or client yet, we encourage you to fill out the contact form to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker