How to use dynamic content in template
1. Placeholders
Placeholders: Below the "Channels" section on the left, you can find placeholders. Placeholders are denoted by {{}} or Handlebars. You may define the parameters of Placeholders by clicking on it, which opens up a pop-up window where you can define them. Check out this comprehensive guide on how to use "Handlebars". Once you add any placeholders in your templates using {{}} and open the Placeholders popup, you will see an option 'New placeholders detected. Add them here?' . When you click YES, then the placeholder will get automatically added here.
2. System Variables
This will have a list of pre-defined system variables in Fyno. There are 4 different types of system varaibles
- Digest
- User
- Subscription
- Verify
Digest
If you use 'Digest' action in your workflow, you will see 3 variables under this section which you can use in your templates.
- head - gives you the top 5 payloads in the digest
- tail - gives you the bottom 5 payloads in the digest
- count - gives you the total count of payloads in the digest
You can read more about how Digest works and how to use these variables in the template here.
User
If you use Fyno's User profile, you will see all the all the user properties linked to a user profile under this section. You can read more about User profiles and how to create user properties here
Subscription
If you want to enabl your users to Opt-in/Opt-out or unsubscribe from your notification, you can use the variables available under Subscription section.
- Opt-in/Opt-out - Use it as part of button payload in WhatsApp templates to enable users to Opt-in/Opt-out of your WhatsApp notifications.
- Unsubscribe - Adds a clickable link in your notification which the user can click to Unsubscribe. Generally used in the footer of the Email templates.
Verify
Fyno Verify offers a fully managed API for seamless multichannel user verification via OTP or link. You can read more about how Fyno Verify works here.
- OTP - Use this variable if you want to generate and Verify OTP.
- Link - Use this variable if you want to validate an Email or Mobile no using a link.
3. Handlebars
Handlebars is a JavaScript library used for creating dynamic templates.
It allows you to define templates with placeholders, and these placeholders are replaced with data when the template is triggered with the information sent in the payload.
Handlebars within Fyno support features like conditional operations, loops, date time formatting, partial searches, and custom helpers, making it a very helpful tool to use when creating your templates.
You can read more about how Handlebar works here
4. Components
The Components feature allows you to build modular, reusable elements such as headers and footers.
By creating these components once, you can easily add them into any email you create, saving time and effort.
You can read more about how Components works here
Updated 1 day ago