For the complete documentation index, see llms.txt. This page is also available as Markdown.

◼️Label tags

Label Tags are different from the user state tags (such as game played, favorite team, etc), with Label Tags you can easily create your own tags in the system, with your own content.

General concept

There are 3 types of label tags - Static text, JavaScript function, and JS function with parameters. Here's one example of how to use a 'Static text' label tag: Create an email template to welcome your users to their new VIP level; Following that, we will have to create the respective Label Tag. Create a welcome_to_vip Label Tag and provide a default value.

Creating a label tag: 1 — Tag name, 2 — Tag value type, 3 — Default value. The Variations tab shows after the first save.

Define the different conditions for each of the players' VIP levels and provide content.

Insert {{label.welcome_to_vip}} label tag in your email body and each VIP user will get their welcome message.

Steps to create a Label tag

  1. Go to the Tools tab on the top menu

  2. Select Label tags from the “Main” section

  3. Click on +Create

  4. Select type - Static text, JavaScript function, or JS function with parameters

  5. Choose the Tag name (i.e. welcome_to_vip)

  6. Put the Default value (i.e. Welcome to VIP Bronze/Silver) and save the tag

  7. Open the Variations tab and click Create to add a variation. Choose the conditions for which users this variation will be affecting and put its Tag value. You can choose a few conditions, like Language, VIP level, Country, specific username, and any property available in our core, and in your product.

When you save a label tag of the Static text type, the back office checks the label tags and user state tags used in its value. If one of them does not exist, the label tag is not saved and you see an error with the names of the missing tags. A new label tag is always checked. When you edit an existing label tag, it is checked only if the Block saving a label tag that uses unknown tags setting in Label settings is on (it is off by default). Communication templates are always checked this way.

Dynamic label tags

In some cases, you need to build a label tag that changes over time.

The most common case is to show a date that is relative to the time when the end-user is getting a communication message, e.g. to build a communication like "The promo code is valid till Jan 15, 2019".

For this need, you can use a Label tag with the type "JavaScript function" and put the code to build dynamic content.

A tag showing the current date

Example of the label tag that builds a date in 4 days from now in the format "15.01.2019"

Tag returning different images based on the current day of the week

Tag returning current day of the week in English

Tag with parameters

In some cases, you might need to build a tag that accepts a parameter. For example below function is calculating an final amount based on base amount and user currency. In order this to happen we need base amount as parameter and user currency which we fetch from the user state property (label tags are supporting tag replacement).

Here is an example on how the above label tag should be inserted: {{label.cash_bonus(15)}} (in this case 15 will be send to the function as amount parameter).

Auto-login with JWT in communications

You can easily create a secure, token-based authentication mechanism for users clicking on links within communications sent via Smartico CRM, leveraging JSON Web Tokens (JWT). The method allows for temporary, self-contained authentication without exposing sensitive credentials.

Note: Auto-login with JWT is supported across all communication channels.

Adopting this feature will allow you to send secure, personalized email links that automatically log your users into their accounts upon clicking, significantly improving user experience and security posture.

Steps to create:

  1. Go to BO > Tools > Label tags > Create JavaScript Function

  1. Choose Tag Name

  2. Choose tag value type - JavaScript function

  3. Paste the JavaScript code below:

  1. Set your own Secret Key - replace MY_SUPER_SECRET_KEY with your own secret key.

  2. Set Token expiration

    1. 3 hours example - exp: now + 3 * 60 * 60 // +3 hours

    2. 10 minutes example - exp: now + 10 * 60 // +10 minutes

  3. Create your email Template and use the tag in the link to your web site, for example, using the button in the mail editor - https://yourwebsite.com/login?jwt={{label.test_jwt_100001}} Replace the {{label.test_jwt_100001}} in the link with the Label tag you have created

  1. Send emails (or any communications) to users or Create campaigns with Emails, choosing the Template you created.

On you website you will need to handle "jwt" parameter, decode it with the secret key and after extracting user_ext_id_clean, do a login for this user.

Last updated

Was this helpful?