About Document Templates

Introduction

Inmobalia CRM’s document templating system offers a high degree of versatility and compatibility with popular word processing applications that support the .DOCX, or .ODT file formats, such as Microsoft Word and LibreOffice Writer. This allows users to leverage their existing proficiency with these applications to design document templates according to their specific requirements.

To create a template, users can compose the document within their preferred word processor, defining the desired text formatting, layout, and static content that will remain consistent across all generated documents. To facilitate the incorporation of dynamic content, such as personalized data or real-time information, the templating system utilizes placeholder tags. These tags are inserted at strategic locations within the document and serve as markers that the system identifies and substitutes with the appropriate data during the document generation process.

The utilization of placeholder tags enables the creation of highly adaptable templates that can accommodate a diverse array of document types, including personalized correspondence, reports, invoices, and certificates. By leveraging the native functionality of the chosen word processing application in conjunction with the templating system’s dynamic content injection capabilities, users can efficiently produce customized documents tailored to their specific use cases.

Template Types

Inmobalia CRM’s templating system supports various template types, each designed to generate documents based on specific data contexts. The two primary template types currently available are Property templates and Contact templates.

Property Templates:

Property templates are designed to generate documents that incorporate data related to a single property stored in the Inmobalia CRM database. When generating a document using a Property template, the system accesses all available information associated with the selected property, including details such as its location, size, features, and pricing. Additionally, the template can access data from related objects, such as the seller’s information, enabling the inclusion of comprehensive property-specific data within the generated document.

Contact Templates:

Contact templates are designed to generate documents that utilize data related to a specific person or contact within the Inmobalia CRM. When generating a document using a Contact template, the system retrieves all available information associated with the selected contact, such as their name, contact details, preferences, and interaction history. This allows for the creation of personalized documents tailored to each individual contact, enhancing communication and engagement.

Future Enhancements:

Inmobalia CRM’s templating system is continuously evolving to support additional template types and data contexts. Upcoming updates will introduce new template types that cater to specific business requirements and data sets, further expanding the system’s versatility and adaptability to various document generation scenarios. As these new template types become available, the documentation will be updated to provide detailed information on their usage and capabilities.

By offering a range of template types, Inmobalia CRM empowers users to generate documents that leverage the wealth of data stored within the system, ensuring that each generated document is tailored to the specific context and requirements of the user’s workflow.

Data Field Naming Conventions

When using data fields within your document templates, Inmobalia CRM follows a straightforward naming convention to ensure clarity and ease of use. The majority of data fields have self-explanatory names that directly correspond to the information they represent. For example, the “address” field refers to the address of a property in the context of a Property template, or the address of a customer in the context of a Contact template.

In addition to simple field names, Inmobalia CRM also supports dotted field names to access data from related objects. Dotted field names consist of the related object’s name followed by a dot and the specific attribute you wish to include. For instance, “seller.fullname” represents the full name of the seller associated with a property when using a Property template. This naming convention allows you to easily incorporate data from related entities within your templates.

For a comprehensive list of available data fields and their descriptions for each type of template, please refer to the correspondent articles at the side of this document.

Data Insertion

Injecting data into your document templates is a simple and intuitive process within Inmobalia CRM’s templating system. To insert dynamic data fields into your templates, you merely need to use tags enclosed in braces ({}).

When designing your template in your preferred word processing application, simply place the desired data field name within a pair of braces at the location where you want the actual data to appear in the generated document. For example, to insert the property address, you would use the tag “{address}” in your template.

Here are a few examples of how to use data field tags in your templates:

This tag will be replaced with the name of the property’s seller:

Dear {seller.name},

These tags will be replaced with the respective property details:

The property located at {address} has {bedrooms} bedrooms and {bathrooms} bathrooms.

These tags will be replaced with the contact’s information:

Thank you for your interest, {seller.name}. We will contact you at {seller.email} or {seller.phone}.

When generating a document, Inmobalia CRM will automatically identify these tags and replace them with the corresponding data stored in the system. This process allows for the creation of highly personalized and data-driven documents with minimal effort.

It’s important to ensure that the data field names used within the tags exactly match the field names provided in the Data Field Reference section of this documentation. Incorrect or misspelled field names will result in the tags remaining unchanged in the generated document.

Conditional Insertion

In certain scenarios, you may want to include specific text or content within your document only when a particular condition is met. Inmobalia CRM’s templating system supports conditional insertion, allowing you to define dynamic sections that are included or excluded based on specified criteria.

To create a conditional block, you need to enclose the desired content within a special tag that starts with {# followed by the condition and ends with }. The content inside the conditional block will only be included in the generated document if the condition evaluates to true.

Conditions can be constructed using various operators:

  • Equality: == (checks if two values are equal)
  • Relational: >, <, >=, <= (compares values)
  • Logical AND: && (requires both conditions to be true)
  • Logical OR: || (requires at least one condition to be true)

You can also use parentheses to define the precedence of operations within a condition.

Here’s an example of a conditional block:

{#direct == true && exclusive == false}We would like to include your property in our sole agency marketing channels. Would you consider giving us exclusivity for your property? Contact {listedby.fullname} at {listedby.email} or {listedby.mobile} if you wisth to explore this option. {/}

In this example, the text asking for exclusivity will only be included in the generated document if we have direct contact with the owner but we do not have a sole agency agreement.

Conditional insertion provides a powerful way to create dynamic content that adapts to specific data scenarios, allowing you to generate tailored documents based on the information stored in your Inmobalia CRM.

Data Field Formatting

Inmobalia CRM’s templating system allows you to format data fields to ensure consistency and readability in your generated documents. To apply formatting to a data field, you can use the pipe character (|) followed by the desired formatter name. It’s important to maintain the correct capitalization when specifying the formatter name.

The available formatters vary depending on the data type of the field. Let’s explore the formatting options for each data type.

String Formatting

You can apply the following formatters to string fields:

  • toUpperCase: Converts the string to uppercase.
  • toLowerCase: Converts the string to lowercase.
  • capitalize: Capitalizes the first letter of each word in the string.
  • replaceNewLine: Delete the new lines by replacing them with a space or any character as an argument.

Example:

{seller.name | toUpperCase}, {seller.name | toLowerCase}, {seller.name | capitalize}

This snippet will show “JOHN DOE, john doe, John Doe

Number Formatting

To format number fields, you can use the formatNumber formatter to separate decimals and group thousands. The characters (dots and commas) used for formatting will depend on the language defined for your template in Inmobalia.

Example:

  • Not formatted: {salePrice}
  • Formatted: {salePrice | formatNumber}

If the template language is set to “Spanish,” the snippet will show:

  • Not formatted: 1430000.45
  • Formatted: 1.430.000,45

Date Formatting

Date fields can be formatted using the formatDate formatter. By default, it will display the date in a format like “6 February 2024.” You can customize the date format by appending a colon (:) followed by the desired format option enclosed in apostrophes (‘).

Inmobalia provides several preset date formats, such as:

  • DATE_SHORT
  • DATE_MED
  • DATE_MED_WITH_WEEKDAY
  • DATE_FULL
  • DATE_HUGE
  • TIME_SIMPLE
  • TIME_24_SIMPLE
  • DATETIME_SHORT
  • DATETIME_MED
  • DATETIME_FULL
  • DATETIME_HUGE

You can also define a custom date format using standard tokens like:

  • yyyy (4-digit year)
  • yy (2-digit year)
  • MM (2-digit month number)
  • MMM (abbreviated month name)
  • MMMM (month name)
  • dd (2-digit day number)
  • HH (24-hour formatted hour)
  • hh (12-hour formatted hour)
  • mm (2-digit minutes)
  • ss (2-digit seconds)
  • ZZ (short timezone offset)
  • ZZZ (abbreviated timezone named offset)
  • ZZZZ (timezone named offset)

Example:

  • Default formatting: {date | formatDate}
  • Preset formatting: {date | formatDate:'DATETIME_SHORT'}
  • Custom formatting: {date | formatDate:'yyyy/MM/dd'}

This snippet will show:

  • Default formatting: 6 February 2024
  • Preset formatting: 24/02/06
  • Custom formatting: 2024/02/24

Phone Formatting

Phone numbers can be formatted in two default formats: INTERNATIONAL (with country prefix) or NATIONAL (without prefix). Use the formatPhone formatter followed by the desired format option enclosed in apostrophes (‘).

Example:

{seller.phone | formatNumber:'INTERNATIONAL'}

This snippet will show “+34 601 000 000

Currency Formatting

To format a number field as a currency value, use the formatCurrency formatter followed by the desired currency’s ISO code.

The template language set in Inmobalia CRM will apply the correct number formatting (dots and commas) and the position of the currency symbol. Decimals will always be rounded to 2 decimals.

Example:

  • Not formatted: {salePrice}
  • Forcing US dollars as currency in a Spanish template: {salePrice | formatCurrency:'USD'}
  • Using currency field in an English template: {salePrice | formatCurrency:currency}

This snippet will show:

  • Not formatted: 1545000.348
  • Forcing US dollars as currency in a Spanish template: 1.545.000,35 $
  • Using currency field in an English template: €1,545,000.35