Part of the Views ecosystem · 286 projects
This module adds a mailmerge-like field to Views, allowing you to create dynamic text content. You can define replacements for specific tokens within a text field, enabling you to insert data from other Drupal fields, site information, or custom values directly into your view output. This is particularly useful for generating personalized content for print or display based on view data.
The module provides a global Views field plugin with mailmerge-like capabilities.
The primary use case for this module is to provide a mail merge facility at the Views field level.
Mailmerge tokens are replaced by the matching value. This can be useful for presenting forms that need to be viewed or printed based on text in a node body and fields from a view. For example, a Webform can be used for data entry and this field can be used to present that information based on a node body that includes tokens.
The field definition includes a Text field and a Mailmerge field.
The Mailmerge field defines one or more key|value substitutions like this:
[text1]|This is a constant
[site_name]|[site:name]
[node:id]|{{ nid }}
[name]|{{ first_name }} {{ last_name }}
This defines four substitutions. The first is a constant. The second uses the global token replacement. The third includes a Views' field value. The final one combines two Views fields.
The tokens in the Text field would be [text1], [site_name], [node:id], [name].
The Text field definition is typically from another Views field like a node body. For example:
This node ([node:id]) is from [site_name].
{{ body }}
The {{ body }} text could include any of the tokens like [name].
Ask your assistant about Views Mailmerge Field
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- views Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Views ecosystem
Most installed first