Communication Templates
Templates are Salesforce records. They are versioned, translatable, channel-aware, and deployable through your normal release process.
Template model
| Field | Purpose |
|---|---|
Name | Developer-stable API name used in code and Flow |
Channel__c | EMAIL, SMS, RCS, WHATSAPP, VOICE, PUSH |
Version__c | Auto-incremented; previous versions retained |
Status__c | Draft, Active, Retired |
Locale__c | Language variant, resolved at send time |
Category__c | Transactional, Service, Operational, Marketing |
Subject__c / Body__c | Content 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:
- Explicit
templateLanguage()on the request - Recipient Contact
Preferred_Language__c - Account or Person Account locale
- 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