Merge Codes / Smart Codes usage

FluentCRM offers lots of dynamic merge codes for your email subject, the body that you can use to personalize your emails.

Basic Structure: #

Merge codes are structured as {{DataGroup.Property|FallbackValue|Transformer}}

  • DataGroup: FluentCRM has different types of data group. Examples: contact, contact.custom, wp etc.
  • Property: Each data groups offer many data values, and you can call that the property. For example: first_name, last_name, email
  • Fallback Valu (Optional)e: This is an optional parameter. If the defined property is empty, the fallback value will be returned.
  • Transformer (optional): Fluent Forms offers utility functions to transform the dynamic return value. For example: {{contact.first_name|Hi|ucfirst}} will make this first letter of the first as uppercase.

Usage: #

Using merge is very easy. From your email composer, just type @ and then type the name or title of the merge code and you can see all of them.

image

You can see all the merge codes by clicking the {{ }} icon in your email composer’s top bar.

image 1

This will show a pop-up and you can copy any SmartCode you want and use it in your email body or subject.

image 2
Merge code Lists

Contact’s Default Merge Codes #

CodeDescription
{{contact.full_name}}Full name of the contact
{{contact.prefix}}Name Prefix of the contact
{{contact.first_name}}First Name of the contact
{{contact.last_name}}Last Name of the contact
{{contact.email}}Email address
{{contact.id}}Contact’s unique ID (Numeric)
{{contact.user_id}}Connected User ID of the contact
{{contact.address_line_1}}Address Line 1
{{contact.address_line_2}}Address Line 2
{{contact.city}}Address City
{{contact.state}}Address State
{{contact.postal_code}}Address Postal Code
{{contact.country}}Address Country
{{contact.phone}}Phone Number
{{contact.status}}Contact’s Status
{{contact.date_of_birth}}Date of Birth
{{contact.custom.CUSTOM_FIELD_SLUG}}Custom Field value of the contact. Please replace CUSTOM_FIELD_SLUG with your defined slug of the field

Other General Codes #

CodeDescription
{{crm.business_name}}Business Name defined in FluentCRM Settings
{{crm.business_address}}Business Address defined in FluentCRM Settings
{{wp.admin_email}}Email Address defined in WordPress settings
{{wp.url}}Your Website URL
{{other.date.+2 days}}Dynamic Date Field. You can replace +2 days with your own date strings. it will return the date (WP Date Format) when parsing the data.
{{other.date_format.PHP_DATE_FORMATS}}Current date field as your own date format. Supports all PHP Date formats.
##crm.unsubscribe_url##Unsubscribe URL of the contact
##crm.manage_subscription_url##Manage Subscription page URL of the contact
##web_preview_url##Web preview Url of an email
{{crm.unsubscribe_html|Unsubscribe}}This will return an unsubscribe link with HTML code and link text will be Unsubscribe.
‘{{crm.manage_subscription_html|Manage Preference}}Manage Subscription Hyperlink HTML with link text “Manage Preference”

WP User Codes #

If the contact is also your WordPress user then you can use the following merge codes in your email

CodeDescription
{{user.ANY_USER_PROPERY}}example: get any user property from WP_User Class. Example: user_login, user_first_name etc.
{{user.meta.USER_META_KEY}}access meta value of a user
{{user.password_reset_direct_link}}Direct Password Reset link of a user

Data Transformers #

Using Data Transformers you can transform / Format a dynamic value easily. Here is the list of available transformers

TransformerUsageDescription
trim{{contact.first_name|There|trim}}if the contact.first_name returns value and have space at first or after it will trim that.
ucfirst{{contact.first_name|There|ucfirst}} /
{{contact.first_name||ucfirst}}
If the contact.first_name returns the first letter lowercase, it will make it uppercase of the first letter
strtolower{{contact.first_name|There|strtolower}} /
{{contact.first_name||strtolower}}
It will make the all the letters as lowercase
strtoupper{{contact.first_name|There|strtoupper}} /
{{contact.first_name||strtoupper}}
It will make the all the letters as uppercase
ucwords{{contact.full_name|There|ucwords}} /
{{contact.full_name||ucwords}}
This will make the first letter of each word uppercase.
concat_first{{contact.first_name||concat_first|Hello}}if a contact’s first name is John then it will return as “Hello John
concat_last{{contact.first_last||concat_last|,}}Sometimes you need to add “,” after the first name if the name exists. This example will return “John,” if the first name exists . If first name does not exist then nothing will return.
show_if{{contact.full_name||show_if|First name exist}}If contact’s full name exist then it will return “First name exist”

Latest comments (25)

Avatar for Drew

I would like to be able to automatically populate today’s date in a date field whenever a contact passes through a particular automation. Is there a smart code for today’s date? or another way to auto-populate the current date to a field?

Avatar for Zoltán

I would like to create a confirmation email template for the different purchase statuses. Is it possible to include product details (product name, quantity, price) using variables? I’ve only found options for order number/ID.”

Avatar for Nazir Himel
Nazir Himel

Hi Zoltan, Yes, you can do that from automations if you use WooCommerce triggers (merge tags for WooCommerce stay hidden unless you’re using WooCommerce triggers). 🙂

Avatar for Tai

I don’t know if anyone has the same problem. Last time I asked how to use Fluentcrm and whether it was possible to send a notification of forgotten password. The customer service said it couldn’t be used.

Later I found a method that can easily solve this problem with Elementor.

First, you need to set up new Tags or Lists in Fluentcrm, and create a user in the automation area to add new Tags or Lists, and open it multiple times in the status field. After setting up, an email will be sent automatically, and the email will contain {{user.password_reset_direct_link}}. (I don’t know if it’s necessary, but I have settings to automatically cancel Tags or Lists after sending.)

And use Elementor’s pop-up window, and put in the “form”, just put the Email field. For the action after “Send”, click Fluentcrm and set the name you created in Tags or Lists. (A Fluentcrm field will appear, where you need to select Email)

In this way, the website’s forgotten password email can be achieved.

Avatar for Flavio Costa
Flavio Costa

Hi, I’m trying to use FluentCRM automation to send messages to WhatsApp, how can I break lines using the body field for automated messages using fluentcrm?
Which code i need to use?

Avatar for Max D

It would be helpful to see a couple of things:
1. How to use multiple Data Transformers at once (i.e. if I want to use trim and ucfirst together)
2. How to replace the merge code if the field isn’t populated. Some of my customer’s haven’t entered their first name, so whilst I want emails to to be addressed to “Hi {{contact.first_name}}”, if {{contact.first_name}} is blank I’d like to replace it with “there” – i.e. “Hi there” instead of “Hi {{contact.first_name}}” – is that possible?
Cheers

Avatar for Shane

Is there a way I can change the CSS of the H3, H2 and H1 styles? Currently, I need to manually change them from their default setting every time I need a headline (changing the colour, font weight, size and alignment of each title).
I also wish to standardise the look of the buttons so others can use the template and reproduce the same look.

Avatar for AB

Small correction needed to the WP User Code for Direct Password Reset link of a user:
%%user.password_reset_direct_link%%
should be
{{user.password_reset_direct_link}}
Hope that helps!

Avatar for בת שבע
בת שבע

תודה רבה!
יש אפשרות להדגיש בצבע רקע רק משפט אחד מסוים?

Avatar for Nazir Himel
Nazir Himel

כן זה אפשרי. פשוט נסה את זה כמו שאתה עושה עם וורדפרס. הערה: זה לא יעבוד אם הגדרת עיצובים גלובליים.