Templates

Renders a client-message template for a real client so staff can edit it in the composer before sending (ITE-1171). Values come from the tenant's records — client, and optionally the patient, appointment and estimate, each of which must belong to the client. Returns plain text for the channels the template claims, plus every {{Token}} left unfilled. Archived templates still render: a draft opened before the archive shouldn't break.

Changed on
post/templates/{id}/render

Request

Path parameters

idstring required

Request body

clientIdstring
patientIdstring nullable
appointmentIdstring nullable
estimateIdstring nullable

The estimate (treatment plan) an estimate follow-up is about.

Response

OK

templateIdstring
templateNamestring
categorystring nullable
channelstring nullable
emailSubjectstring nullable
emailBodystring nullable
smsBodystring nullable
unresolvedTokensstring[]

Every {{Token}} still in the returned text, in order of first appearance: fields with no single data source (ReferralClinicName, EstimateLink…), fields whose record wasn't given or is blank, and tokens that aren't merge fields for the category. Staff fill or remove each one before the composer lets the message go.

Changes