Inserting Queried Data into an Approved Email
Content creators can use the {{customContent}} token to query information from Vault CRM and add that information to content, greatly enhancing flexibility when adding information to content.
The token can directly reference any field of a supported object reference field type, along with retrieving values from .txt attachment fields.
Who can use this feature?
- Browser, iPad, iPhone Users
- Users require an Approved Email license
- Content Creator Users
Configuring Attachment Fields for the Custom Content Token for

Attachment field functionality in the {{customContent}} token requires additional configuration. The attachment fields must sync to the device for the token to reference their values in Approved Email. To ensure specific attachment fields are synced to the device, administrators can specify them in the Include Attachment Field List field on the object's VMOC.
To configure this feature:
- Navigate to Admin > Configuration > Objects > VMobile Object Configuration > Layouts.
- Add the Include Attachment Field List (include_attachment_field_list__v) field to the appropriate object layouts.
- Navigate to Admin > Users & Groups > Permission Sets.
- Select the appropriate permission set.
- Select the Objects tab.
- Grant the following permissions:
Object
Object Permission
Object Type
Fields
Field Permission
vmobile_object_configuration__v
CRE
tablet__v
- include_attachment_field_list__v
Edit

To configure this feature:
- Navigate to Admin > Users & Groups > Permission Sets.
- Select the appropriate permission set.
- Select the Objects tab.
- Grant the following permissions:
Object
Object Permission
Object Type
Fields
Field Permission
vmobile_object_configuration__v
R
tablet__v
- include_attachment_field_list__v
Read
- Navigate to Business Admin > Objects > VMobile Object Configurations.
- Select the VMOC linked to the object whose attachment fields are used in the Custom Content token.
- Select Edit.
- Enter the attachment fields in the include_attachment_field_list__v field using a double semi-colon delimited list. This list is case-sensitive.
- Ensure the VMOC is Active.
- Select Save.
Using the Custom Content Token as

The {{customContent}} token uses a SQL-like querying language. The WHERE clause can reference any supported merge token field from the following Vault CRM objects using the {{ObjectName.FieldName}} format:
- account__vod
- address__vod
- approved_document__vod (only supported in email template)
The token uses the general format:
{{customContent[QUERY]}}
Where QUERY is replaced by a SQL-like query using the = operator.
For example:
{{customContent[SELECT field__c FROM my_object__c where zip__c = '{{address__v.zip__v}}' and product__c = 'Cholecap']}}
The returned value is stored in the email_config_value__v field on the sent_email__v object. If multiple results are returned, the first result is stored.
Addresses marked as Primary Addresses always return first if they match the query.
The token is case-sensitive, and should not contain extra spaces.
Ensure end users have at least Read field permission to all fields referenced by this token.
Marking the Custom Content Token as Required
The custom content token can be marked as required by adding :Required after the query:
{{customContent[QUERY]:Required}}
Emails cannot be sent if a required token returns NULL.
Inserting Attachment Field Values Using the Custom Content Token
The {{customContent}} token can access data stored in a plain text file (extension .txt) in an attachment type field on any object to be inserted into the email. This plain text can consist of HTML tags. The HTML is rendered with the appropriate styling once inserted into the email.
The file in the attachment type field must be a .txt file under 1.2MB. Other file types do not return a value and the token is rendered as an empty string in the email.
Using the {{customContent}} token to access attachment type fields is supported in Email Templates, Email Fragments, and Template Fragments.
For example, formulary_table__c is an attachment field on the formulary_data__c object. This field is used to store the formulary_table.txt file, which contains HTML used to render a formulary table personalized for an account.
The following token retrieves the HTML from the formulary_table.txt file stored in the formulary_table__c attachment field. This HTML is inserted into the email content to display the formulary table:
{{customContent[SELECT formulary_table__c FROM formulary_data__c where account__c = '{{account__v.id}}']}}