Create email template
lnkdrp_create_email_templateCreates an email template in the workspace: a name, a format (text or html), a subject and a body with replaceable tags. Tags are written {{entity.field}}, or {{entity.field|fallback}} for text used when the value is empty. Built-in tags, filled by LinkDrop for each recipient: contact.firstName: The first word of the contact's name. (e.g. Ken); contact.name: The contact's name: the name the team gave them, else the name they gave. (e.g. Ken Lee); contact.lastName: Everything after the first word of the contact's name. (e.g. Lee); contact.email: The contact's email address. (e.g. ken@example.com); contact.company: The domain of the contact's address; empty for a webmail address such as gmail.com. (e.g. acme.com); contact.note: The team's note on the contact, as written; it goes into the email exactly as it is. (e.g. Met at the October demo day.); contact.tags: The contact's tags, comma-separated. (e.g. Investor, Seed); contact.firstSeen: When LinkDrop first saw the contact, e.g. October 22, 2026. (e.g. October 22, 2026); contact.lastSeen: When the contact was last seen, e.g. October 22, 2026. (e.g. October 22, 2026); contact.visits: How many times the contact has viewed, as a number. (e.g. 3); link.url: The recipient's own LinkDrop link to the document or project; one link per person, reused on every render. (e.g. https://lnkdrp.com/s/example); link.password: The password of the recipient's own link; empty when the link has none. Filled when the email is sent and for a member signed in to the app; a connected agent sees [password]. (e.g. chris58); document.title: The document's title (document emails only). (e.g. Q3 investor update); project.name: The project's name (project emails only). (e.g. Series A data room); sender.name: The name of the member the email is from. (e.g. Chris); sender.firstName: The first word of the sender's name. (e.g. Chris); sender.email: The sender's LinkDrop account email (not necessarily the Gmail address the email goes out from). (e.g. chris@example.com); workspace.name: The workspace's name. (e.g. LinkDrop). {{link.url}} is one link per recipient: their own LinkDrop link to the one document or project the email is rendered for, reused on every render. A template's links (its own documents and projects) put several in one email, each wherever its {{link.}} is written: every recipient gets their own tracked link to each. A project is the other way: one link to all of its documents. {{link.url}} appears in every template without links; a template with links places at least one of them. Custom tags are {{custom.name}}, each declared in tags with a description of what it stands for, and hold words taken from lnkdrp_render_email's values; a custom tag whose name or description reads as a link (..._link, ..._url, an address) is refused as validation with details.code custom_tag_is_link. An unknown tag, a template without {{link.url}} (or, with links, without any of them), a single-document tag beside two or more links, or an HTML body with scripts, frames, forms or event attributes is refused as validation with details.code (unknown_tag, bad_tag, link_tag_required, link_tag_ambiguous, html_not_allowed, custom_tag_is_link). An HTML body shows images only from this workspace's uploads: an image is uploaded with lnkdrp_upload_email_asset and placed with the imgTag it returns (lnkdrp_list_email_assets lists those already uploaded). Any other image source (another site, data:) is refused as validation with details.code image_not_an_asset, on save, render and send; a javascript: URL or a is details.code html_not_allowed. The text version shows an image as [alt]. Each image is kept under 10 MB on every plan (big images make emails slow to open and more likely to be clipped or land in spam): an uploaded image over it in the body is swapped for a smaller copy on save. One email shows at most 10 images, 20 MB in all: over that, the save makes the images smaller, the largest first, until the email fits (reason email). imagesResized [{ name, from, to, assetId, note, reason }] lists each one. When it cannot fit, the save is refused as validation with details.code too_many_images or images_too_heavy, a sentence saying the limit and what to change, and details.limits. Returns the template with every tag it uses (entity, description, required, example), unusedTags: declared custom tags the text does not use, and warnings: notes as { code, message } on a template that saved as sent. body_self_centred: the html body's outermost element centres itself with auto side margins (margin: 0 auto) while align is left, so the email still shows centred; the body is saved unchanged. link_unused: one of the template's links is not placed in the body, so that document goes out to no one. no_documents: the template has no links of its own, so each drop or email made from it takes its document from its own docId or projectId. A name already used in the workspace is validation with details.code name_taken. At the workspace's cap on active templates it is validation with details.code templates_limit (archived templates are not counted, so archiving one makes room), and past its new templates in 24 hours, created and duplicated alike, it is rate_limited with details.code templates_daily_limit and details.retryAt; both caps are the plan's (capabilities.outreachLimits in lnkdrp_whoami) and details.limit says the one reached. New email templates are private to their owner (the person this connection acts for) unless visibility is team; this is not a document's visibility (lnkdrp_set_doc_visibility). Names are unique across private and team templates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The body, with tags (up to 50,000 characters); contains {{link.url}} at least once, or, for a template with links, at least one {{link.<key>}}. | |
| name | Yes | The template's name, unique in the workspace (1-80 characters). | |
| tags | No | Tag declarations: every {{custom.x}} used, with its description; a built-in may be listed to override its description or required. | |
| align | No | Where an html email sits in the reader's window. left (the default): nothing is added around the body, so it shows flush left. center: the body is placed in a centred column at most 600px wide. The text version is unaffected. | |
| links | No | The template's documents and projects, each placed in the body by {{link.<key>}} wherever it should appear (as often as wanted). Every recipient gets their own tracked link to each, made with its settings, when the email is rendered; a send or render then needs no docId or projectId. With one, {{link.url}} also means it; with two or more, {{link.url}}, {{link.password}}, {{document.title}} and {{project.name}} are refused (link_tag_ambiguous). On an update the list replaces the template's documents. | |
| format | Yes | text: a plain-text body (an HTML version is derived from it). html: an HTML body (a text version is derived from it). | |
| subject | Yes | The subject line, with tags (one line, up to 200 characters). | |
| visibility | No | private: only its owner sees the email template. team: everyone in the workspace sees it. Not a document's visibility (lnkdrp_set_doc_visibility). | |
| description | No | What the template is for (up to 500 characters). |