Skip to content

Flavors

SMS RCML has a single content flavor. The flavor is fixed — the <rc-sms> element always uses SMS RFM.

SMS RFM

SMS RFM (SMS Rule Flavor Markdown) is a directive-only markdown dialect for SMS message bodies. There is no block structure — the entire body is a flat sequence of text, links, and dynamic placeholders. Newlines are preserved literally in the output.

Parsed by smsRfmToJson(). Serialised back to SMS RFM by jsonToSmsRfm().

Supported constructs

SyntaxProducesDescription
Plain textmessage nodeStatic text, including embedded \n for line breaks
:link[url]{track shorten}link nodeTrackable / shortened URL
::placeholder{…}placeholder nodeDynamic merge-tag (subscriber field, custom field, date, …)
[Type:Name] shorthandplaceholder nodeCompact alias for ::placeholder{…}
::unsubscribemessage + placeholder pairRequired unsubscribe footer — see Unsubscription

Machine-readable spec

The full flavor spec is available as smsRfmSpec:

typescript
import { smsRfmSpec } from '@rule/rcml';

smsRfmSpec.flavors['sms-rfm-content'].topLevelNodes
// → ['message', 'link', 'placeholder']