Letter templates

Render a letter template

Fills a template's placeholders with one real record's values and returns the finished text. Nothing is sent and nothing is stored — this is the preview a property manager sees before pressing send.

POST
https://services.magicdoor.com/communications/company-portal/letter-templates/{id}/render

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

idstringrequired

The letter template to render. A 64-bit number sent as a string.

example: 1830472847398404096

Body

application/json

channelenum<string>required

Which kind of record entityId is. It must be one the template lists in its own communicationChannels. The three remaining channels — rentalApplication, propertyManager and company — cannot be rendered here and come back as a 400.

tenantownervendorleasemaintenanceRequestworkOrder
entityIdstringrequired

The record to read the values from, and it must match channel: a tenant id for tenant, a lease id for lease, a work order id for workOrder, and so on. A 64-bit number sent as a string.

messageTypeenum<string>required

Which of the template's two bodies to render. email renders emailBody and also returns the subject; chat renders chatContent and returns no subject.

emailchat

Response

200 · The rendered message.

subjectstring

The rendered email subject. Absent when messageType was chat, and absent when the template has no subject.

bodystringrequired

The rendered body — HTML for email, plain text for chat.

400 · The template does not list `channel` among its channels, has no content for `messageType`, or `channel` is one of the three that cannot be rendered.

401 · The access token is missing, expired, or not a property-manager token.

404 · The template, or the record named by `entityId`, does not exist or belongs to another company.