Appearance
Rule.io SDK / rcml/src / jsonToSmsRfm
Function: jsonToSmsRfm()
jsonToSmsRfm(
json):string
Defined in: rcml/src/sms/json-to-sms-rfm.ts:28
Convert an SmsContentJson document back to an SMS RFM string.
Reverse of smsRfmToJson. Serialization rules:
messagenodes → text verbatim (embedded\nstays as-is)linknodes →:link[url]{track="..." shorten="..."}placeholdernodes →::placeholder{type="..." original="..." name="..." ...}directive form- the two-node unsubscribe footer (
is-unsubscribe: trueon both) →::unsubscribe
Parameters
json
Typed SMS content JSON ({ type: 'sms', content: [...] }).
Returns
string
SMS RFM string.
Example
ts
const json = smsRfmToJson('Account: [Subscriber:email]')
const rfm = jsonToSmsRfm(json)
// rfm === 'Account: ::placeholder{type="Subscriber" original="[Subscriber:email]" name="email"}'