Skip to main content
Skip table of contents

Providing custom tokens and templates for mailer documents

You can provide third-party mailer templates in the Document Manager so that users can easily create personalized documents for their contacts based on templates. For example, you can import third-party birthday mailer templates with matching criteria into a Document Manager folder so that users can select this folder to print personalized birthday messages for their contacts.

NexJ CRM supports the use of third-party mailer template tokens as custom tokens for merge fields.

Support for third-party mailer template tokens

Your users can create documents such as birthday mailers for contacts based on third-party mailer templates. You can map a third-party mailer template token to an existing NexJ CRM merge field by entering it as a custom token for the merge field. NexJ CRM then populates the same merge fields when a template containing either of the mapped tokens is used to batch print documents. You must enable the Birthday Mailer feature before you enter third-party mailer template tokens as custom tokens for merge fields. Merge fields are added and modified using the Document Codes page in NexJ Admin Console.

Mapped tokens

The following table shows sample third-party mailer template tokens that have been mapped to some of the NexJ CRM merge fields. At any time, you can change the third-party mailer template token mapped to a NexJ CRM merge field by editing the custom token entered for the merge field.

Third-party mailer template token nameNexJ token nameDescription
LetterDatenowCurrent date
CompanycompanyCompany name
AddressNamefullNameTitleFirstLastTitle, first name, and last name
Address1homeAddress address1Home address line 1
Address2homeAddress address2Home address line 2
Address3homeAddress address3Home address line 3
CityhomeAddressCityHome city
StatehomeAddressStateHome state
ZiphomeAddressZipHome ZIP code
SalutationdearSalutation
BirthdaybirthdaySummaryStringBirthday: Month Day
SignatoryLine1userFullNameFirstLastUser's first and last name
SignatoryCredentials1userAffixA name suffix for a user that provides additional information about a user; for example, their educational degree, such as PhD
SignatoryTitle1userFullPositionUser's position and company
SignatoryInitialsuserInitialsUser's initials
SignatoryLastName1userLastNameUser's last name
SignatoryFirstName1userFirstNameUser's first name

Importing mailer templates

You can import mailer templates for Document Manager items in NexJ Admin Console. For example, you can import birthday mailer templates and matching criteria into a Document Manager folder so that users with appropriate privileges (BirthdayMailerView) can batch print birthday messages for contacts by selecting the folder.

This topic assumes you have a basic understanding of Scheme expressions and have access to your business model. All Scheme expressions are case sensitive.

Before you can import mailer templates, you must create a ZIP file that contains:

  • A CSV file that includes a column for mailer template names, a column for the matching criteria for each template written as Scheme expressions, and a column for the user-friendly descriptions of the Scheme expressions in each row. The matching criteria enable NexJ CRM to find a template for each selected contact by matching contact attributes to template metadata when users initiate the batch print operation.

    The following example Scheme expression matches female contacts who turn 50 years of age or older on their next birthday with a birthday mailer template:

    CODE
    (and (= (@ genderCode value) (AdminGenderEnum'FEMALE)) (<= (@ birthTime)
    (date-add-years (date-shift (((invocation-context)'timeZone)'id)
    ((TimeZoneEnum'get 'EtcslashUTC)'shortCaption) (now)) -49)))
  • All mailer template attachment files

The CSV file must not contain a row with headers.

The following image shows an example CSV file.

Also, you must create the folders in the Document Manager that will contain the imported templates. For more information about creating Document Manager folders, see "Managing Document Manager folders" in the end-user documentation.

To import mailer templates:

  1. In the NexJ Admin Console toolbar, click Import MailersThe Import Mailers dialog displays.
  2. Browse and select the ZIP file that contains the CSV file and the required template attachments.
  3. In the Folder field, select the Document Manager folder that will contain the templates after they are uploaded.
  4. Click OK to save your changes.

The mailer templates are imported into their Document Manager folders and a Document Manager item is created for each template listed in the CSV. Each of the items has a template attachment. When specified in the CSV, the matching criteria are displayed in the Matching Criteria column in the Document Manager data table for documents and the Edit Document dialog for the document in Document Manager.

If you want the Matching Criteria field to display user-friendly descriptions and not the actual Scheme expressions, ensure that you have included a user-friendly description for the matching criteria for each mailer template in the CSV.

If you want to make a change later to the matching criteria in the CSV file, you will have to delete the affected templates and then re-import the templates using your modified CSV file.

Adding merge fields


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.