Message Templates
The Message Templates add-on provides a flexible and efficient way to manage and utilize reusable message templates within your Jmix application. It allows developers to define templates with placeholders, which can be dynamically populated with data at runtime. This add-on simplifies the creation of personalized messages such as emails or in-app notifications.
Overview
This add-on allows you to create and customize message templates that combine static content with dynamic parameters. You can design templates using either the visual HTML designer, which provides a wide range of HTML elements. The visual HTML editor offers a comprehensive toolkit for template design, making it easy to craft engaging and professional messages.

Message Template Engine
The message generation process leverages the widely-adopted Apache FreeMarker Template Engine. The system supports the creation of both HTML
and Plain Text
templates for maximum flexibility in your messaging.
HTML Template Editor
The powerful GrapesJS web component has been integrated to provide a user-friendly, visual editor for crafting HTML templates. This editor enables you to construct templates using a library of pre-designed HTML blocks. You can easily design your templates by simply dragging and dropping these blocks from the palette onto the canvas, streamlining the template creation process.
Features
-
Centralized Template Management: Store all your message templates in one location, making them easy to access, edit, and maintain.
-
Template Types: The add-on supports both HTML and plain text templates, providing flexibility in formatting your messages.
-
Apache FreeMarker Integration: Leverages the robust Apache FreeMarker Template Engine, allowing you to use placeholders, expressions, loops, conditional logic, and other powerful features within your templates. This means you can create dynamic, data-driven messages.
-
Visual HTML Template Editor: The built-in GrapesJS-based visual editor simplifies the process of creating HTML templates through a drag-and-drop interface, letting you construct templates using a library of pre-designed blocks. No advanced HTML coding skills required.
-
Reusability: Create templates once and use them in multiple areas of your application.
-
Parameterization: Templates can use parameters passed during message generation, enabling personalization and data-driven content.
Additionally
The Message Templates add-on supports integration with other Jmix add-ons:
-
Multitenancy add-on. When both the Multitenancy and Message Templates add-ons are installed, templates, blocks, and groups are automatically segregated by tenant. This ensures that each tenant has access to their own set of templates, maintaining data isolation and security.
-
Email Sending add-on. By installing the Email Sending add-on, you gain the ability to send emails generated from message templates. This integration allows you to create dynamic, template-based emails and send them directly from your application.
-
Notifications add-on. Installing the Notifications add-on enhances your application’s functionality by enabling the use of pre-made message templates when creating notifications. This integration simplifies the process of generating consistent and personalized notifications for users. For detailed information about the integration with the Notifications add-on, please refer to the Using with Notifications section.
Installation
For automatic installation through Jmix Marketplace, follow instructions in the Add-ons section.
For manual installation, add the following dependency to your build.gradle
:
implementation 'io.jmix.messagetemplates:jmix-messagetemplates-flowui-starter'
implementation 'io.jmix.messagetemplates:jmix-messagetemplates-starter'