Real Messaging Engine

Communication Templates

Templates are Salesforce records. They are versioned, translatable, channel-aware, and deployable through your normal release process.

Template model

FieldPurpose
NameDeveloper-stable API name used in code and Flow
Channel__cEMAIL, SMS, RCS, WHATSAPP, VOICE, PUSH
Version__cAuto-incremented; previous versions retained
Status__cDraft, Active, Retired
Locale__cLanguage variant, resolved at send time
Category__cTransactional, Service, Operational, Marketing
Subject__c / Body__cContent with merge syntax

Merge syntax

<p>Hi {{Contact.FirstName}},</p>

<p>Your order <strong>{{Order.OrderNumber}}</strong> shipped on
   {{Order.ShippedDate | date: "MMMM d, yyyy"}}.</p>

{{#if Order.TrackingNumber}}
  <p><a href="{{Order.TrackingUrl}}">Track your shipment</a></p>
{{else}}
  <p>Tracking details follow within 24 hours.</p>
{{/if}}

{{#each Order.Items}}
  <p>{{this.Quantity}} × {{this.ProductName}} — {{this.Total | currency}}</p>
{{/each}}

Available filters: date, currency, number, upper, lower, truncate, default, urlencode, escape.

Versioning and rollout

Activating a new version does not break in-flight sends: queued messages keep the version resolved at request time. Roll back by reactivating a prior version — history is never overwritten.

Localization

Create one template per locale sharing a Name. RME resolves the locale in this order:

  1. Explicit templateLanguage() on the request
  2. Recipient Contact Preferred_Language__c
  3. Account or Person Account locale
  4. Org default locale

Testing

RME_TemplateRenderer.Preview p = RME_TemplateRenderer.preview(
    'Order_Confirmation', 'en_US', order.Id, contact.Id);
System.debug(p.subject);
System.debug(p.htmlBody);
System.debug(p.missingMergeFields);  // empty list = safe to activate

The admin UI offers the same preview with a live record picker and a send-to-me test.

Continue to Personalization.

Was this helpful?

Last updated 1 month ago