Merge codes in a template

Thijs Jan Hoving Updated by Thijs Jan Hoving

For more information about creating a template click here.

It is possible to work with merge codes within a template that retrieves data from Newbase.

1. Add a mergecode

  1. Open the template in which you want to add a merge code
  2. For the available merge codes, click on the icon below within the widget Message Body Text

​A list of modules opens

  1. Open the module you want to use a merge code for
  1. Click on the desired field and the code will be copied automatically
  2. Now go to the place in the text where you want to use the code and paste the code
  3. When finished click save

2. Format of a date mergecode

If you have added a date mergecode the default format used while replacing is dd-MM-yyyy, like 02-08-2026.

A format can be set by adding it directly after the mergecode.

De structure is:

%%mergecode%%[dateformat:your_dateformat]

Example: %%delivery_date_import%%[dateformat:d MMMM yyyy]

"[dateformat:" should be directly behind the closing "%%" of the mergecode and the format should be closed by "]".

Now it is possible to have a written month name in the text to prevent confusing dates, like for example 03-04-2026. In Europa this is being read as 3 April, but in the USA this could be interpreted as 4 March.

To be used in the dateformat

upper / lower case is meaningful in this context

using date 2 augustus 2026, dutch language

y: year

example for year 2026:

yy: year without century, becomes "26"

yyyy: year with century, becomes "2026"

M: month

example for month 8:

M: month nr. without leading 0, becomes "8"

MM: month nr. with leading 0, becomes "08"

MMM name short, becomes "aug"

MMMM name full, becomes "augustus"

d: day in the month

example for day 2 in the month:

d: day nr. without leading 0, becomes "2"

dd: day nr. with leaading 0, becomes "02"

E: dayname in the week

explample for day zondag:

E, EE, EEE dayname short, becomes "zo"

EEEE, dayname full, becomes "zondag"

Examples (based on 2 augustus 2026):

  • d-M-yy: 2-8-26
  • dd/MM/yyyy: 02/08/2026
  • d MMM yyyy: 2 aug 2026
  • EE d MMM yyyy: zo 2 aug 2026
  • EEEE d MMMM yyyy: zondag 2 augustus 2026
  • MMMM d, yyyy: augustus 2, 2026

When the mergecode is used in a message or financial document, for example a sales invoice, first language and country are detected, and based on that the written components (dayname / montname) will be written in that language.

  • Example for a document to Germany (country DE), language 'de', formaat "EEEE d MMMM yyyy": Sonntag 2 August 2026
  • Example for a document to Finland, language 'fi', format "EEEE d MMMM yyyy": sunnuntai 2 elokuuta 2026

How did we do?

How do you create a template for a message or a start/end text of a document?

Link attachement to template

Contact