xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField SalesCRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Administration/Email templates and document numbering
HOW-TO · Last reviewed

Email templates and document numbering

VIDEO
Email templates & document numbering
A 4-minute walkthrough of this page is coming soon — the written steps below cover the same ground.

Two pieces of tenant configuration shape how your documents look to the world: messaging templates — reusable, entity-bound messages that merge record data when a rule, approval or subscription sends them — and document numbering — automatic, structured names such as SO-2609-000042 written onto new records. Both live under Setup → Feature Hub → Platform.

Prerequisites

  • Messaging templates: the setup.metadata.email.manage capability. Bind a template to an entity so its fields are available as merge variables; a template without an entity (Global) can only use tokens the sending feature supplies.
  • Document numbering: access to Feature Hub, plus a decision about which entity and which field receives the generated name, and what the number should look like.
  • Delivery: e-mail goes out through your organization's messaging channel configuration (Setup → Feature Hub → Service → Messaging Channels). Templates for the other channels — SMS, chat, messaging apps, quick text — can be authored today, but only e-mail delivery is wired; treat the other channels as drafts until your organization's delivery setup covers them.

Procedure

Step 1 — Create a template

Go to Setup → Feature Hub → Platform → Email Templates. The screen is titled Messaging Templates and manages every channel, not e-mail alone. The list shows Name (opens the designer), Label, Entity (or Global), Channel, Kind, Editor, Default and State, with row actions Design, Edit, Clone and Delete.

Messaging Templates list under Feature Hub → Platform → Email Templates with Name, Label, Entity, Channel, Kind, Editor and Default columns and Design, Edit, Clone and Delete actions
The list is the template's operating contract: entity binding decides which record fields can become variables, Channel and Kind decide which features can pick the template, and Default marks the fallback per entity and kind.UI captured
  1. 1

    New creates the definition — Label, Name, Entity, Channel, Editor Mode, Kind, Active, Default template.

  2. 2

    Name opens the designer; it is the stable identifier a rule directive references.

  3. 3

    Entity, or Global for templates that only use tokens the sending feature supplies; locked after creation.

  4. 4

    Channel and Kind: only Email is delivered today; Report and Dashboard Subscription kinds appear in subscription dialogs.

  5. 5

    Default marks the fallback template a rule without an explicit template sends.

  6. 6

    Design opens the Formula Builder and content editor; Edit changes the definition; Clone copies it.

Select New and fill in:

FieldMeaning
Label (required) and NameThe wording administrators recognise, and the stable technical name that rules reference.
EntityThe record type the template is about; locked after creation. Leave empty for a Global template.
ChannelEmail, SMS, Chat, messaging app or Quick Text. Rich-text content is available for Email only.
Editor ModeText only, HTML only, or Text + HTML — which bodies the designer offers.
KindGeneral for rule and approval messages; Report Subscription and Dashboard Subscription for the templates offered in subscription dialogs.
ActiveOnly active templates are offered to consumers.
Default templateMarks this template as the fallback for its entity and kind — what a rule without an explicit template sends.

Confirm the row shows the intended Entity, Channel and Kind before authoring: those are the template's operating contract, while subject and body are content you can refine any time.

Step 2 — Author the content in the designer

Open the template with Design (or its name). The designer has two panels. Formula Builder on the left holds the template's variables: Add variable (available when the template is entity-bound) defines a named variable and the expression that fills it from the record — a field, or a path through a lookup such as the account's name on an order. Template Content on the right holds the Subject and the body tabs — Plain Text, and Rich Text for e-mail templates whose editor mode includes HTML.

Insert variables as tokens: the variable name wrapped in a pair of curly braces on each side, as the Subject field's hint text shows (spaces inside the braces are tolerated; letters, digits, underscore and dots are allowed, so dotted paths work). At send time each token is replaced by its variable's value for the record being sent about. A token whose name matches no variable renders as empty text, not as an error — so check token spelling against the variable list before relying on a template.

Step 3 — Test with a real send

There is no preview button in the designer or on the list. To see what a template renders, wire it into its consumer (Step 4) against a test record — a draft business rule fired on a scratch record, or an approval on a test document — and read the result in the message log under Setup → Platform Operations → Monitoring → Message Log, which shows the rendered subject and delivery status. Fix blank tokens by matching the variable name or by populating the field on the test record, then re-send.

Step 4 — Put the template to work

Templates are consumed by the features that send messages:

  • Business rules — the SendMessage action takes a directive such as template=OrderConfirmation;channels=email;to=field:Email (the to part accepts a field name, owner, or an address; subject= and body= override the template's content; channels= may also list inapp for an in-app notification). See business rules.
  • Approval processes — the process carries a template per event: submit, approve, reject, recall and revert. See approvals.
  • Report and dashboard subscriptions — the subscription dialog offers templates of kind Report Subscription or Dashboard Subscription. See subscriptions.

Resolution at send time is: the explicit template id → the template name → the Default template for the entity and kind → the platform's built-in default. Consumers store a reference, so editing a template's content changes future sends without touching the rule, approval or subscription. Sends are rendered once and queued; the sender address and provider come from the messaging channel configuration, not from the template. User invitation and password e-mails are a separate platform system and are not restyled through these templates.

Step 5 — Configure document numbering

Go to Setup → Feature Hub → Platform → Document Settings (Configure how document names are generated per entity: series, date format and running sequence). The list shows Name (opens the detail page), Label, Entity, Destination Field, Default Series, Date Format, Number Length, Active, Created and Modified; row actions are Edit and Delete.

Document Settings list showing one numbering setting per entity with Destination Field, Default Series, Date Format and Number Length columns
Each row is a numbering recipe for one entity and one destination field: the series prefix, the date pattern and the zero-padded length that make up names like SO-2609-000042.UI captured
  1. 1

    Open the name for the detail page and its Document Numbers tab, where Last Number Used per series can be adjusted.

  2. 2

    Entity is the record type whose new records receive a generated name; several settings may target one entity if they write different fields.

  3. 3

    Destination Field receives the name — usually Name or a document-number field.

  4. 4

    Default Series is the prefix when no Series Field supplies one; the counter is keyed on this resolved text tenant-wide.

  5. 5

    Date Format is a label inside the name; it does not reset the counter.

  6. 6

    New settings start inactive — review the recipe, then switch Active on.

Select New and define the recipe:

FieldMeaning
Label, NameDisplay and technical names of the setting.
Entity (required)The record type whose new records receive a generated name.
Destination FieldThe field that receives the generated name — commonly Name or a document-number field.
Series FieldA field on the record that supplies the series prefix per record (a branch code, a document type). May be a calculated field.
Default SeriesThe fixed prefix used when no Series Field is set or the field is blank.
Date FieldThe field whose date supplies the date portion; blank uses the creation date.
Date FormatThe pattern for the date portion, for example yyMM or {DD}{MM}{YYYY}; leave blank for no date part.
Number LengthZero-padded width of the running number.
SeparatorOne character placed between series, date and number.
ActiveNew settings are inactive until you switch this on, so you can review the recipe first.

The generated name is series + separator + date part + separator + zero-padded number — with Default Series SO, format yyMM, length 6 and separator -, the 42nd document is SO-2609-000042. Several active settings may target the same entity as long as they write different fields (a Name and a purchase-order number, say).

Step 6 — Understand how sequences run

  • Names are generated on record creation only — never when a record is previewed or edited, so previews do not consume numbers and existing records are never renumbered.
  • Generation runs before business-rule set value actions on the same save, so a Series Field formula must not depend on a value a rule sets.
  • The counter belongs to the series string, tenant-wide: every record whose resolved series is SO advances the same counter, whatever entity, date or setting produced it. The date portion is a label inside the name, not a reset — a monthly date format does not restart numbering each month.
  • Numbers are allocated in atomic blocks, so bulk imports and concurrent users get consecutive, non-colliding numbers.
  • The detail page's Document Numbers tab lists each series with its Last Number Used; Edit last number used lets you move a counter forward (or back to a minimum of 0) when migrating from a previous system. Moving a counter backwards can produce duplicate names on entities that do not enforce uniqueness — do it only on an empty series.

Expected result

The messaging template appears under the intended entity, channel and kind, a test send renders every token from the sample record, and the consuming rule, approval or subscription keeps its reference so later wording changes flow into future messages. The document setting is Active and produces correctly prefixed, dated and padded values on newly created records of its entity; existing records keep their identifiers, and the Document Numbers tab shows the series advancing.

Common problems

  • A token renders blank in a real send. Either the variable name does not match the token (unknown tokens render empty) or the field is empty on that record. Compare the token with the Formula Builder list first, then check the record.
  • The message never arrives. Rarely the template. Check the message log for the queued send and its status, then the messaging channel configuration. A template on an SMS, chat or messaging-app channel is not delivered — only e-mail delivery is wired.
  • A rule sends the wrong template. The rule has no explicit template and falls back to the entity's Default template; either name the template in the directive or fix which template carries Default.
  • Two document families share numbers. They resolve to the same series string. Give each family its own Default Series or Series Field value; the date part does not separate counters.
  • New setting produces nothing. It is still inactive (new settings default to inactive), or the entity already had a value in the destination field on the incoming record.

Common questions

Can two entities share one numbering sequence?

Yes — and they will whether you intend it or not. The counter is keyed on the resolved series string for the whole tenant, so two settings whose series resolve to the same text advance one sequence. Use distinct series values when document families must be independent.

Do existing records get renumbered when I add or change a setting?

No. Names are generated only when a record is created. Records that existed before the setting keep whatever value the destination field held, and changing the format later affects only records created after the change.

Can I reword a template without touching the automation that sends it?

Yes. Rules, approvals and subscriptions reference the template by id or name, so editing its subject or body changes future sends without rebuilding the consumer. Because there is no preview, make the change and check the next send in the message log.

Which channels actually deliver?

E-mail. Templates can be authored for SMS, chat, messaging apps and quick text so the content is ready, but those channels are not connected to a delivery provider in the current release; a rule that lists them sends only the e-mail (and in-app) parts.