Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.
Lettr templates let you manage email designs in the Lettr dashboard while your application provides the dynamic data. This separation means designers can update email layouts without touching application code, and developers can change data without worrying about design.This page covers sending templates, versioning, and managing templates programmatically via the API.
The array keys correspond to merge tags in your template (e.g., {{first_name}}). If a required merge tag is missing from the array, the tag renders as an empty string in the sent email. See Merge Tags & Template Language for the full syntax including conditionals and loops.
Use the Get Merge Tags method to retrieve the list of available merge tags for a template. This helps you ensure you’re providing all required data when sending.
Template Versioning
Specify a template version to use a specific iteration:
Omit the templateVersion parameter to use the active (published) version. Lettr always serves the most recently published version unless you explicitly request a different one.When to use versioning:
Production safety — Pin to a known-good version so publishing a new draft doesn’t affect live emails
A/B testing — Send different versions to different cohorts and compare metrics in Analytics
Gradual rollout — Test a new version with a subset of users before publishing it as the active version
See Template Versions for how versioning works in the Lettr dashboard.
Using the Builder
For more control, use the email builder with templates:
The builder combines template usage with other email features like tracking, metadata, and custom headers. Use it when you need fine-grained control over the email alongside template content.
You can override the template’s subject line by calling ->subject() on the builder. This is useful for adding dynamic content to subjects, like order numbers or user names.
Listing Templates
Retrieve available templates via the API:
use Lettr\Dto\Template\ListTemplatesFilter;$response = $lettr->templates()->list();foreach ($response->templates as $template) { echo $template->name . ' (' . $template->slug . ')';}// With pagination and filtering$filter = ListTemplatesFilter::create() ->projectId(123) ->perPage(20) ->page(2);$response = $lettr->templates()->list($filter);
The list method returns basic template information including name, slug, and active version. Use this to build dynamic template selectors in your application or verify that templates exist before sending.
Cache the template list in your application to avoid repeated API calls. Templates don’t change frequently, so a cache with a 5-10 minute TTL is usually sufficient.
Get Template Details
$template = $lettr->templates()->get('welcome-email');echo $template->name;echo $template->slug;echo $template->html;echo $template->activeVersion;echo $template->versionsCount;// With specific project$template = $lettr->templates()->get('welcome-email', projectId: 123);
The html property contains the full HTML content of the template, including merge tags. Use this to preview templates or implement custom template editing in your application.
The HTML returned from the API includes Lettr’s merge tag syntax. You’ll need to process substitutions yourself if you want to preview with actual data — or just send a test email using the API’s built-in substitution engine.
Get Merge Tags
Retrieve merge tags (template variables) from a template:
$response = $lettr->templates()->getMergeTags('welcome-email');foreach ($response->mergeTags as $tag) { echo $tag->key; // e.g., 'user_name' echo $tag->required; // true/false echo $tag->type; // e.g., 'string', 'object' // Nested tags (for objects) if ($tag->children !== null) { foreach ($tag->children as $child) { echo $child->key; echo $child->type; } }}// With specific project and version$response = $lettr->templates()->getMergeTags( 'welcome-email', projectId: 123, version: 2,);
Merge tags define the dynamic data your template expects. The response includes:
key — The merge tag name (used in {{key}} syntax)
required — Whether the tag must be provided when sending
type — Data type (string, object, array)
children — Nested tags for objects and arrays
Use this method to:
Validate that you’re providing all required data before sending
Build dynamic forms for template data input
Generate type-safe DTOs in statically-typed languages
When working with nested data structures (objects and arrays), check the children property to understand the full shape of the expected data. This is especially important for loop blocks that iterate over arrays.
Create a Template
use Lettr\Dto\Template\CreateTemplateData;use Lettr\Enums\TemplatePurpose;// With HTML content$template = $lettr->templates()->create(new CreateTemplateData( name: 'My Template', projectId: 123, html: '<html>...</html>', // provide html OR json, not both));// A marketing template, the only kind a campaign can use$template = $lettr->templates()->create(new CreateTemplateData( name: 'March newsletter', html: '<html>...</html>', purpose: TemplatePurpose::Campaign,));echo $template->id;echo $template->slug; // generated from the name; you do not supply oneecho $template->purpose->value;
purpose is set once and cannot be changed. Omit it and you get a transactional template, which a campaign cannot use — and purpose is not accepted by the update endpoint, so the only remedy is to copy the template in the app. If the content is going to an audience, set it now. See Transactional vs. Marketing Templates.
Creating templates programmatically is useful for:
Migrating templates from another email service
Generating templates from a design system or component library
Building template management features in your application
Template slugs must be unique within your account. If you try to create a template with an existing slug, the API returns a 422 validation error.
Delete a Template
$lettr->templates()->delete('my-template');// With specific project$lettr->templates()->delete('my-template', projectId: 123);
Deleting a template is permanent and cannot be undone. All template versions are deleted. If any emails in your application reference this template slug, they will fail to send after deletion.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/schema.json","name":"Lettr","colors":{"primary":"#EC104B","light":"#F04070","dark":"#D00E43"},"logo":{"light":"https://mintcdn.com/lettr/w6cQMnBCGTvjJ4__/logo/light.svg?fit=max\u0026auto=format\u0026n=w6cQMnBCGTvjJ4__\u0026q=85\u0026s=2cad5a94a80e61999cf9feaeac06e9c6","dark":"https://mintcdn.com/lettr/w6cQMnBCGTvjJ4__/logo/dark.svg?fit=max\u0026auto=format\u0026n=w6cQMnBCGTvjJ4__\u0026q=85\u0026s=2d94948c6f2c26d1375758ec890ccd4b","href":"/introduction"},"favicon":"https://mintcdn.com/lettr/MeT4pWpyRN-RhvgL/favicon.svg?fit=max\u0026auto=format\u0026n=MeT4pWpyRN-RhvgL\u0026q=85\u0026s=800c7fba1be1e2324447ed3b67ef0a48","api":{},"appearance":{"default":"dark"},"navbar":{"links":[{"href":"https://status.lettr.com/","label":"Status"},{"href":"https://lettr.com/support","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.lettr.com"}},"footer":{"socials":{"x":"https://x.com/lettr_com","linkedin":"https://www.linkedin.com/company/lettr-com","github":"https://github.com/lettr-com"}},"fonts":{"heading":{"family":"Manrope","weight":400},"body":{"family":"Manrope"}},"integrations":{"ga4":{"measurementId":"G-GMH8JTRY9Q"},"posthog":{"apiKey":"phc_67BYz5Uv0uoiydQyaN3OyeK9OPx6LjmFDFvF0mNaTy9","apiHost":"https://eu.i.posthog.com","sessionRecording":true}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lettr","hasAudioNarration":false,"actualSubdomain":"lettr","customDomains":["docs.lettr.com"],"gitSource":{"type":"github","owner":"lettr-com","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"edits":true,"thumbs":true,"issues":true},"entitlements":{},"buildId":"6b002a891e592fb6624e59a3","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"Documentation","count":186},{"language":"default","tag":"Learn","count":110},{"language":"default","tag":"Knowledge Base","count":87},{"language":"default","tag":"API Reference","count":72},{"language":"default","tag":"Quickstart","count":68},{"language":"default","tag":"DNS Guides","count":19},{"language":"default","tag":"Templates","count":18},{"language":"default","tag":"Domains","count":16},{"language":"default","tag":"Email Fundamentals","count":15},{"language":"default","tag":"Troubleshooting","count":15}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--rounded: 0px;--rounded-sm: 0px;--rounded-md: 0px;--rounded-lg: 0px;--rounded-xl: 0px;--rounded-2xl: 0px;--rounded-3xl: 0px;--rounded-search: 0px;--c15t-radius-sm: 0px;--c15t-radius-md: 0px;--c15t-radius-lg: 0px;--cdt-radius: 0px;--accordion-radius: 0px;--button-border-radius: 0px;--consent-banner-border-radius: 0px;--consent-dialog-card-radius: 0px;--consent-widget-radius: 0px;--consent-widget-accordion-radius: 0px;--frame-placeholder-border-radius: 0px;--scrollbar-track-radius: 0px;--scrollbar-thumb-radius: 0px;--scrollbar-corner-radius: 0px}*,*::before,*::after,::backdrop,::file-selector-button{border-radius:0!important}[class~=\"rounded-full\"],[class~=\"rounded-full!\"]{border-radius:9999px!important}.prose :where(ul>li)::before,.prose-sm :where(ul>li)::before,.latex-style ul>li::before{border-radius:50%!important}.sdk-list{--sdk-fg: rgb(24 14 19);--sdk-muted: rgb(24 14 19 / 0.55);--sdk-line: rgb(60 20 35 / 0.1);--sdk-hover: rgb(236 16 75 / 0.035);--sdk-code-bg: rgb(60 20 35 / 0.035);--sdk-code-line: rgb(60 20 35 / 0.12);--sdk-accent: #d00e43;--sdk-ease: cubic-bezier(0.22, 1, 0.36, 1);margin:1.25rem 0 2.5rem;border-top:1px solid var(--sdk-line)}.dark .sdk-list{--sdk-fg: rgb(250 242 245);--sdk-muted: rgb(250 242 245 / 0.5);--sdk-line: rgb(255 225 235 / 0.09);--sdk-hover: rgb(240 64 112 / 0.05);--sdk-code-bg: rgb(255 225 235 / 0.035);--sdk-code-line: rgb(255 225 235 / 0.1);--sdk-accent: #f04070}.sdk-row{position:relative;display:grid;grid-template-columns:1.25rem 8.75rem minmax(0, 1fr) 1rem;align-items:center;column-gap:1rem;padding:0.875rem 0.75rem;border-bottom:1px solid var(--sdk-line);transition:background-color 180ms var(--sdk-ease)}.sdk-row:hover{background-color:var(--sdk-hover)}.sdk-row:has(.sdk-row__name:focus-visible){outline:2px solid var(--sdk-accent);outline-offset:-2px}.sdk-row__logo{display:flex;align-items:center;justify-content:center;color:var(--sdk-muted);transition:color 180ms var(--sdk-ease)}.sdk-row__logo svg,.sdk-row__logo span{background-color:currentColor!important}.sdk-row:hover .sdk-row__logo{color:var(--sdk-fg)}.sdk-row__name{position:static!important;z-index:auto!important;font-size:0.9375rem;font-weight:600;letter-spacing:-0.005em;color:var(--sdk-fg);text-decoration:none;white-space:nowrap}.sdk-row__name:focus-visible{outline:none}.sdk-row__name::after{content:\"\";position:absolute;inset:0}.sdk-row__install{position:relative;z-index:1;justify-self:start;display:inline-flex;align-items:center;gap:0.625rem;max-width:100%;min-width:0;padding:0.3125rem 0.5rem 0.3125rem 0.625rem;border:1px solid var(--sdk-code-line);background:var(--sdk-code-bg);color:var(--sdk-fg);cursor:pointer;transition:border-color 180ms var(--sdk-ease)}.sdk-row__install:hover{border-color:var(--sdk-accent)}.sdk-row__install:focus-visible{outline:2px solid var(--sdk-accent);outline-offset:2px}.sdk-row__install code{padding:0!important;border:0!important;background:none!important;color:inherit!important;overflow:hidden;font-size:0.8125rem;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.sdk-row__copy{display:flex;flex-shrink:0;color:var(--sdk-muted);transition:color 180ms var(--sdk-ease)}.sdk-row__install:hover .sdk-row__copy,.sdk-row__copy[data-copied=\"true\"]{color:var(--sdk-accent)}.sdk-row__arrow{color:var(--sdk-muted);transition:transform 220ms var(--sdk-ease),\n color 180ms var(--sdk-ease)}.sdk-row:hover .sdk-row__arrow{color:var(--sdk-accent);transform:translate(2px, -2px)}.sdk-row__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sdk-list--inline{margin:0 0 1.25rem}:has(+.sdk-list--inline){margin-bottom:0.625rem!important}@media (max-width: 640px){.sdk-row{grid-template-columns:1.25rem minmax(0, 1fr) 1rem;row-gap:0.625rem;padding:0.875rem 0.5rem}.sdk-row__install{grid-row:2;grid-column:2 / 4;justify-self:stretch;justify-content:space-between;min-height:2.75rem;padding-block:0.5rem;text-align:left}.sdk-row__install code{white-space:normal;overflow-wrap:anywhere}}@media (prefers-reduced-motion: reduce){.sdk-row,.sdk-row__logo,.sdk-row__install,.sdk-row__copy,.sdk-row__arrow{transition:none}.sdk-row:hover .sdk-row__arrow{transform:none}}.whitespace-pre-wrap>pre.shiki,.whitespace-pre-wrap>pre.shiki code{white-space:pre-wrap!important;overflow-wrap:anywhere}[data-component-part=\"card-icon\"]:has(>img[src*=\"/images/integrations/\"]){display:flex;align-items:center;width:auto}[data-component-part=\"card-icon\"]>img[src*=\"/images/integrations/\"]{width:auto;height:1.25rem;object-position:-9999px 0;background-color:rgb(var(--primary));mask:var(--partner-logo) center / contain no-repeat}.dark [data-component-part=\"card-icon\"]>img[src*=\"/images/integrations/\"]{background-color:rgb(var(--primary-light))}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/apiant.svg\"]{--partner-logo: url(\"/images/integrations/apiant.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/composio.svg\"]{--partner-logo: url(\"/images/integrations/composio.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/elaichi.svg\"]{--partner-logo: url(\"/images/integrations/elaichi.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/flowrunner.svg\"]{--partner-logo: url(\"/images/integrations/flowrunner.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/mindcloud.svg\"]{--partner-logo: url(\"/images/integrations/mindcloud.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/one.svg\"]{--partner-logo: url(\"/images/integrations/one.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/tray.svg\"]{--partner-logo: url(\"/images/integrations/tray.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/truto.svg\"]{--partner-logo: url(\"/images/integrations/truto.svg\")}[data-component-part=\"card-icon\"]>img[src*=\"/integrations/unified.svg\"]{--partner-logo: url(\"/images/integrations/unified.svg\")}"}]}
{"page":{"pagePath":"quickstart/php/templates","slug":"/quickstart/php/templates","pageMetadata":{"title":"Using Templates","description":"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.","href":"/quickstart/php/templates"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,Note,Tip,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Lettr templates let you manage email designs in the Lettr dashboard while your application provides the dynamic data. This separation means designers can update email layouts without touching application code, and developers can change data without worrying about design.`}),`\n`,_jsx(_components.p,{children:`This page covers sending templates, versioning, and managing templates programmatically via the API.`}),`\n`,_jsx(Heading,{level:`2`,id:`sending-with-templates`,children:`Sending with Templates`}),`\n`,_jsx(_components.p,{children:`The simplest way to send a template email:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`emails`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sendTemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'sender@yourdomain.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'user@example.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` subject`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Welcome!'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` templateSlug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'welcome-email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` substitutionData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'first_name'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'John'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'activation_url'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://example.com/activate/abc123'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The array keys correspond to merge tags in your template (e.g., `,_jsx(_components.code,{children:`{{first_name}}`}),`). If a required merge tag is missing from the array, the tag renders as an empty string in the sent email. See `,_jsx(_components.a,{href:`/learn/templates/template-language`,children:`Merge Tags \u0026 Template Language`}),` for the full syntax including conditionals and loops.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Use the `,_jsx(_components.a,{href:`#get-merge-tags`,children:`Get Merge Tags`}),` method to retrieve the list of available merge tags for a template. This helps you ensure you’re providing all required data when sending.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`template-versioning`,children:`Template Versioning`}),`\n`,_jsx(_components.p,{children:`Specify a template version to use a specific iteration:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`emails`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sendTemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'sender@yourdomain.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'user@example.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` subject`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Welcome!'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` templateSlug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'welcome-email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` templateVersion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` substitutionData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'first_name'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'John'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Omit the `,_jsx(_components.code,{children:`templateVersion`}),` parameter to use the active (published) version. Lettr always serves the most recently published version unless you explicitly request a different one.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`When to use versioning:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Production safety`}),` — Pin to a known-good version so publishing a new draft doesn’t affect live emails`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A/B testing`}),` — Send different versions to different cohorts and compare metrics in `,_jsx(_components.a,{href:`/learn/analytics/introduction`,children:`Analytics`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Gradual rollout`}),` — Test a new version with a subset of users before publishing it as the active version`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/learn/templates/versions`,children:`Template Versions`}),` for how versioning works in the Lettr dashboard.`]}),`\n`,_jsx(Heading,{level:`2`,id:`using-the-builder`,children:`Using the Builder`}),`\n`,_jsx(_components.p,{children:`For more control, use the email builder with templates:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`emails`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`emails`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'sender@yourdomain.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'recipient@example.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`subject`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Your Order #{{order_id}}'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`useTemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'order-confirmation'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`substitutionData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'order_id'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '12345'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'customer_name'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'John Doe'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'items'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'name'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Product A'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'price'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 29.99`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'name'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Product B'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'price'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 49.99`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'total'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 79.98`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The builder combines template usage with other email features like tracking, metadata, and custom headers. Use it when you need fine-grained control over the email alongside template content.`}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`You can override the template’s subject line by calling `,_jsx(_components.code,{children:`->subject()`}),` on the builder. This is useful for adding dynamic content to subjects, like order numbers or user names.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`listing-templates`,children:`Listing Templates`}),`\n`,_jsx(_components.p,{children:`Retrieve available templates via the API:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Lettr\\\\Dto\\\\Template\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`ListTemplatesFilter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`templates`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ' ('`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slug`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ')'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With pagination and filtering`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$filter`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ListTemplatesFilter`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`perPage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`page`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The list method returns basic template information including name, slug, and active version. Use this to build dynamic template selectors in your application or verify that templates exist before sending.`}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Cache the template list in your application to avoid repeated API calls. Templates don’t change frequently, so a cache with a 5-10 minute TTL is usually sufficient.`})}),`\n`,_jsx(Heading,{level:`2`,id:`get-template-details`,children:`Get Template Details`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'welcome-email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`html`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`activeVersion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`versionsCount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With specific project`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'welcome-email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`html`}),` property contains the full HTML content of the template, including merge tags. Use this to preview templates or implement custom template editing in your application.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`The HTML returned from the API includes Lettr’s merge tag syntax. You’ll need to process substitutions yourself if you want to preview with actual data — or just send a test email using the API’s built-in substitution engine.`})}),`\n`,_jsx(Heading,{level:`2`,id:`get-merge-tags`,children:`Get Merge Tags`}),`\n`,_jsx(_components.p,{children:`Retrieve merge tags (template variables) from a template:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getMergeTags`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'welcome-email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mergeTags`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $tag`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $tag`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`key`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// e.g., 'user_name'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $tag`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`required`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// true/false`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $tag`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// e.g., 'string', 'object'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Nested tags (for objects)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$tag`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`children`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$tag`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`children`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $child`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $child`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`key`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $child`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With specific project and version`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getMergeTags`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'welcome-email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Merge tags define the dynamic data your template expects. The response includes:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`key`}),` — The merge tag name (used in `,_jsx(_components.code,{children:`{{key}}`}),` syntax)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`required`}),` — Whether the tag must be provided when sending`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`type`}),` — Data type (string, object, array)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`children`}),` — Nested tags for objects and arrays`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Use this method to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Validate that you’re providing all required data before sending`}),`\n`,_jsx(_components.li,{children:`Build dynamic forms for template data input`}),`\n`,_jsx(_components.li,{children:`Generate type-safe DTOs in statically-typed languages`}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`When working with nested data structures (objects and arrays), check the `,_jsx(_components.code,{children:`children`}),` property to understand the full shape of the expected data. This is especially important for loop blocks that iterate over arrays.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-template`,children:`Create a Template`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Lettr\\\\Dto\\\\Template\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`CreateTemplateData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Lettr\\\\Enums\\\\`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`TemplatePurpose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With HTML content`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` CreateTemplateData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'My Template'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` html`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003chtml>...\u003c/html>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// provide html OR json, not both`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// A marketing template, the only kind a campaign can use`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` CreateTemplateData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'March newsletter'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` html`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003chtml>...\u003c/html>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` purpose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`TemplatePurpose`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Campaign`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// generated from the name; you do not supply one`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $template`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`purpose`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`purpose`}),` is set once and cannot be changed.`]}),` Omit it and you get a transactional template, which a `,_jsx(_components.a,{href:`/learn/campaigns/introduction`,children:`campaign`}),` cannot use — and `,_jsx(_components.code,{children:`purpose`}),` is not accepted by the update endpoint, so the only remedy is to copy the template in the app. If the content is going to an audience, set it now. See `,_jsx(_components.a,{href:`/learn/templates/projects#transactional-vs-marketing-templates`,children:`Transactional vs. Marketing Templates`}),`.`]})}),`\n`,_jsx(_components.p,{children:`Creating templates programmatically is useful for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Migrating templates from another email service`}),`\n`,_jsx(_components.li,{children:`Generating templates from a design system or component library`}),`\n`,_jsx(_components.li,{children:`Building template management features in your application`}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Template slugs must be unique within your account. If you try to create a template with an existing slug, the API returns a `,_jsx(_components.code,{children:`422`}),` validation error.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`delete-a-template`,children:`Delete a Template`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`delete`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'my-template'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With specific project`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$lettr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`templates`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`delete`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'my-template'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Deleting a template is permanent and cannot be undone. All template versions are deleted. If any emails in your application reference this template slug, they will fail to send after deletion.`})}),`\n`,_jsx(Heading,{level:`2`,id:`what’s-next`,children:`What’s Next`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Topol Email Editor`,icon:`paintbrush`,href:`/learn/templates/topol-editor`,children:_jsx(_components.p,{children:`Design templates with the visual email editor`})}),_jsx(Card,{title:`Template Language`,icon:`code`,href:`/learn/templates/template-language`,children:_jsx(_components.p,{children:`Learn merge tag syntax, conditionals, and loops`})}),_jsx(Card,{title:`API Reference`,icon:`book`,href:`/api-reference/templates/list-templates`,children:_jsx(_components.p,{children:`Complete template API reference`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Using Templates","description":"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.","href":"/quickstart/php/templates"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Sending with Templates","slug":"sending-with-templates","depth":2,"children":[]},{"title":"Template Versioning","slug":"template-versioning","depth":2,"children":[]},{"title":"Using the Builder","slug":"using-the-builder","depth":2,"children":[]},{"title":"Listing Templates","slug":"listing-templates","depth":2,"children":[]},{"title":"Get Template Details","slug":"get-template-details","depth":2,"children":[]},{"title":"Get Merge Tags","slug":"get-merge-tags","depth":2,"children":[]},{"title":"Create a Template","slug":"create-a-template","depth":2,"children":[]},{"title":"Delete a Template","slug":"delete-a-template","depth":2,"children":[]},{"title":"What’s Next","slug":"what’s-next","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"lettr","siteName":"Lettr","title":"Using Templates - Lettr","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-11T11:15:42.062Z","originalFileLocation":"quickstart/php/templates.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Lettr\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Using Templates - Lettr\">\u003cmeta data-mint-head property=\"og:description\" content=\"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Lettr\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.lettr.com/quickstart/php/templates\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lettr.mintlify.site/_mintlify/api/og/v2?division=PHP\u0026amp;title=Using+Templates\u0026amp;description=Send+Lettr+templates+with+substitution+data%2C+pin+template+versions%2C+retrieve+merge+tags%2C+and+manage+templates+via+the+API+in+the+PHP+SDK.\u0026amp;theme=6d36e4ae9c92b67d8136c8c1\u0026amp;signature=1c45c0aa5a82db377ca7a63d4bccc7015df234a67366a3bf00039a07b8a4788a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Using Templates - Lettr\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lettr.mintlify.site/_mintlify/api/og/v2?division=PHP\u0026amp;title=Using+Templates\u0026amp;description=Send+Lettr+templates+with+substitution+data%2C+pin+template+versions%2C+retrieve+merge+tags%2C+and+manage+templates+via+the+API+in+the+PHP+SDK.\u0026amp;theme=6d36e4ae9c92b67d8136c8c1\u0026amp;signature=1c45c0aa5a82db377ca7a63d4bccc7015df234a67366a3bf00039a07b8a4788a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lettr/dSsCtMUFma4ICJBo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Lettr\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EC104B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.lettr.com/quickstart/php/templates\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/quickstart/php/templates.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.lettr.com/#organization\",\"name\":\"Lettr\",\"url\":\"https://docs.lettr.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lettr/w6cQMnBCGTvjJ4__/logo/light.svg?fit=max\u0026auto=format\u0026n=w6cQMnBCGTvjJ4__\u0026q=85\u0026s=2cad5a94a80e61999cf9feaeac06e9c6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.lettr.com#website\",\"name\":\"Lettr\",\"url\":\"https://docs.lettr.com\",\"publisher\":{\"@id\":\"https://docs.lettr.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.lettr.com/quickstart/php/templates#webpage\",\"url\":\"https://docs.lettr.com/quickstart/php/templates\",\"name\":\"Using Templates\",\"description\":\"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.\",\"dateModified\":\"2026-09-11T11:15:42.062Z\",\"isPartOf\":{\"@id\":\"https://docs.lettr.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.lettr.com/quickstart/php/templates#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.lettr.com/quickstart/php/templates#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Quickstart\",\"item\":\"https://docs.lettr.com/quickstart/laravel/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https://docs.lettr.com/quickstart/php/introduction\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using Templates\",\"item\":\"https://docs.lettr.com/quickstart/php/templates\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.lettr.com/quickstart/php/templates#article\",\"headline\":\"Using Templates\",\"name\":\"Using Templates\",\"description\":\"Send Lettr templates with substitution data, pin template versions, retrieve merge tags, and manage templates via the API in the PHP SDK.\",\"url\":\"https://docs.lettr.com/quickstart/php/templates\",\"mainEntityOfPage\":{\"@id\":\"https://docs.lettr.com/quickstart/php/templates#webpage\"},\"dateModified\":\"2026-09-11T11:15:42.062Z\",\"publisher\":{\"@id\":\"https://docs.lettr.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.lettr.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Lettr\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Lettr\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/quickstart/php/templates.md","siteName":"Lettr","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Introduction","href":"/introduction"}]},{"group":"Quickstart","pages":[{"group":"Laravel","pages":[{"title":"Introduction","href":"/quickstart/laravel/introduction"},{"title":"Installation","href":"/quickstart/laravel/installation"},{"title":"Sending Emails","href":"/quickstart/laravel/sending-emails"},{"title":"Templates","href":"/quickstart/laravel/templates"},{"title":"Type Safety","href":"/quickstart/laravel/type-safety"},{"title":"Managing Domains","href":"/quickstart/laravel/domains"},{"title":"Managing Webhooks","href":"/quickstart/laravel/webhooks"},{"title":"Audience","href":"/quickstart/laravel/audience"},{"title":"Campaigns","href":"/quickstart/laravel/campaigns"}]},{"group":"PHP","pages":[{"title":"Getting Started","href":"/quickstart/php/introduction"},{"title":"Installation","href":"/quickstart/php/installation"},{"title":"Sending Emails","description":"Send emails with the Lettr PHP SDK using quick send methods, the fluent email builder, templates with substitution data, and attachments.","href":"/quickstart/php/sending-emails"},{"title":"Using Templates","href":"/quickstart/php/templates"},{"title":"Managing Domains","description":"List, add, verify, and delete sending domains and check DKIM and CNAME status with the domains service in the Lettr PHP SDK.","href":"/quickstart/php/domains"},{"title":"Managing Webhooks","href":"/quickstart/php/webhooks"},{"title":"Audience","href":"/quickstart/php/audience"},{"title":"Campaigns","href":"/quickstart/php/campaigns"}]},{"group":"Node.js","pages":[{"title":"Getting Started","href":"/quickstart/nodejs/introduction"},{"title":"Installation","href":"/quickstart/nodejs/installation"},{"title":"Sending Emails","href":"/quickstart/nodejs/sending-emails"},{"title":"Templates","href":"/quickstart/nodejs/templates"},{"title":"Managing Domains","href":"/quickstart/nodejs/domains"},{"title":"Managing Webhooks","href":"/quickstart/nodejs/webhooks"},{"title":"Audience","href":"/quickstart/nodejs/audience"},{"title":"Campaigns","href":"/quickstart/nodejs/campaigns"},{"title":"Next.js","href":"/quickstart/nodejs/nextjs"},{"title":"Nuxt Integration","href":"/quickstart/nodejs/nuxt"}]},{"group":"Python","pages":[{"title":"Getting Started","href":"/quickstart/python/quickstart"},{"title":"Advanced","href":"/quickstart/python/advanced"},{"title":"Templates","href":"/quickstart/python/templates"},{"title":"Managing Domains","href":"/quickstart/python/domains"},{"title":"Managing Webhooks","href":"/quickstart/python/webhooks"},{"title":"Audience","href":"/quickstart/python/audience"},{"title":"Campaigns","href":"/quickstart/python/campaigns"},{"title":"Flask Integration","href":"/quickstart/python/send-with-flask"},{"title":"FastAPI","href":"/quickstart/python/send-with-fastapi"}]},{"group":"SMTP","pages":[{"title":"Getting Started","href":"/quickstart/smtp/introduction"},{"title":"Laravel","href":"/quickstart/smtp/laravel"},{"title":"PHPMailer","href":"/quickstart/smtp/phpmailer"},{"title":"Supabase","href":"/quickstart/smtp/supabase"}]},{"group":"Serverless","pages":[{"title":"Getting Started","href":"/quickstart/serverless/introduction"},{"title":"AWS Lambda","href":"/quickstart/serverless/aws-lambda-quickstart"},{"title":"AWS Lambda Advanced","href":"/quickstart/serverless/aws-lambda-advanced"},{"title":"Vercel Functions","href":"/quickstart/serverless/vercel-quickstart"},{"title":"Vercel Functions Advanced","href":"/quickstart/serverless/vercel-advanced"},{"title":"Cloudflare Workers","href":"/quickstart/serverless/cloudflare-quickstart"},{"title":"Cloudflare Workers Advanced","href":"/quickstart/serverless/cloudflare-advanced"}]},{"group":"Go","pages":[{"title":"Getting Started","href":"/quickstart/go/quickstart"},{"title":"Advanced","href":"/quickstart/go/advanced"},{"title":"Templates","href":"/quickstart/go/templates"},{"title":"Managing Domains","href":"/quickstart/go/domains"},{"title":"Managing Webhooks","href":"/quickstart/go/webhooks"},{"title":"Audience","href":"/quickstart/go/audience"},{"title":"Campaigns","href":"/quickstart/go/campaigns"}]},{"group":"Rust","pages":[{"title":"Getting Started","href":"/quickstart/rust/quickstart"},{"title":"Advanced","href":"/quickstart/rust/advanced"},{"title":"Templates","href":"/quickstart/rust/templates"},{"title":"Managing Domains","href":"/quickstart/rust/domains"},{"title":"Managing Webhooks","href":"/quickstart/rust/webhooks"},{"title":"Audience","href":"/quickstart/rust/audience"},{"title":"Campaigns","href":"/quickstart/rust/campaigns"}]},{"group":"Java","pages":[{"title":"Getting Started","href":"/quickstart/java/quickstart"},{"title":"Advanced","href":"/quickstart/java/advanced"},{"title":"Templates","href":"/quickstart/java/templates"},{"title":"Managing Domains","href":"/quickstart/java/domains"},{"title":"Managing Webhooks","href":"/quickstart/java/webhooks"},{"title":"Audience","href":"/quickstart/java/audience"},{"title":"Campaigns","href":"/quickstart/java/campaigns"}]}]},{"group":"Learn","pages":[{"group":"AI Assistant","pages":[{"title":"Meet Adamko","href":"/learn/ai-assistant/introduction"},{"title":"Onboarding \u0026 Setup","href":"/learn/ai-assistant/onboarding-and-setup"},{"title":"Templates \u0026 Campaigns","href":"/learn/ai-assistant/content-creation"},{"title":"Troubleshooting \u0026 Diagnostics","href":"/learn/ai-assistant/troubleshooting-and-diagnostics"},{"title":"Audience \u0026 Imports","href":"/learn/ai-assistant/audience-and-imports"},{"title":"Guided Tours \u0026 Nudges","href":"/learn/ai-assistant/guided-tours-and-nudges"},{"title":"Activity Log \u0026 Undo","href":"/learn/ai-assistant/activity-log-and-undo"},{"title":"Privacy, Permissions \u0026 Limits","href":"/learn/ai-assistant/privacy-and-limits"}]},{"group":"API Keys","pages":[{"title":"API Keys Introduction","href":"/learn/api-keys/introduction"},{"title":"Permissions","href":"/learn/api-keys/permissions"},{"title":"Sandbox API Keys","href":"/learn/api-keys/sandbox"}]},{"group":"Domains","pages":[{"title":"Domains Introduction","href":"/learn/domains/introduction"},{"title":"Sending Domains","href":"/learn/domains/sending-domains"},{"title":"Tracking Domains","href":"/learn/domains/tracking-domains"},{"title":"Inbound Domains","href":"/learn/domains/inbound-domains"},{"title":"Storage Domains","href":"/learn/domains/storage-domains"},{"title":"SPF Records","href":"/learn/domains/spf"},{"title":"DKIM Records","href":"/learn/domains/dkim"},{"title":"DMARC Records","href":"/learn/domains/dmarc"},{"title":"BIMI Records","href":"/learn/domains/bimi"},{"title":"Domain Approval Process","href":"/learn/domains/approval"},{"title":"Domain Connect","href":"/learn/domains/domain-connect"}]},{"group":"Sending","pages":[{"title":"Sending Introduction","href":"/learn/sending/introduction"},{"title":"Recipients","href":"/learn/sending/recipients"},{"title":"Content Types","href":"/learn/sending/content-types"},{"title":"Attachments","href":"/learn/sending/attachments"},{"title":"Tracking","href":"/learn/sending/tracking"},{"title":"Email Tags","href":"/learn/sending/tags"},{"title":"Metadata","href":"/learn/sending/metadata"},{"title":"Batch Sending","href":"/learn/sending/batch-sending"},{"title":"Test Emails","href":"/learn/sending/test-emails"},{"title":"Idempotency","href":"/learn/sending/idempotency"},{"title":"Errors \u0026 Retries","href":"/learn/sending/errors-retries"},{"title":"Email History","href":"/learn/sending/email-history"},{"title":"Email Usage \u0026 Quotas","href":"/learn/sending/usage-quotas"},{"title":"Best Practices","href":"/learn/sending/best-practices"}]},{"group":"Inbound","pages":[{"title":"Inbound Introduction","href":"/learn/inbound/introduction"},{"title":"Inbound Email Setup","href":"/learn/inbound/setup"},{"title":"Routing","href":"/learn/inbound/routing"},{"title":"Attachments","href":"/learn/inbound/attachments"},{"title":"Spam Filtering","href":"/learn/inbound/spam-filtering"},{"title":"Reply Tracking","href":"/learn/inbound/reply-tracking"},{"title":"Email Parsing","href":"/learn/inbound/parsing"},{"title":"Security","href":"/learn/inbound/security"},{"title":"Best Practices","href":"/learn/inbound/best-practices"},{"title":"Inbound Sandbox","href":"/learn/inbound/sandbox"}]},{"group":"Suppressions","pages":[{"title":"Introduction","href":"/learn/suppressions/introduction"},{"title":"Bounces","href":"/learn/suppressions/bounces"},{"title":"Complaints \u0026 Unsubscribes","href":"/learn/suppressions/complaints-unsubscribes"}]},{"group":"Templates","pages":[{"title":"Templates Introduction","href":"/learn/templates/introduction"},{"title":"Topol Email Editor","href":"/learn/templates/topol-editor"},{"title":"Editor Settings","href":"/learn/templates/editor-settings"},{"title":"Premade Templates","href":"/learn/templates/premade-templates"},{"title":"Template Language","href":"/learn/templates/template-language"},{"title":"Projects \u0026 Folders","href":"/learn/templates/projects"},{"title":"Template Versions","href":"/learn/templates/versions"},{"title":"Comments","href":"/learn/templates/comments"},{"title":"Saved Blocks","href":"/learn/templates/saved-blocks"},{"title":"Loop Blocks","href":"/learn/templates/loop-blocks"},{"title":"Image Storage","href":"/learn/templates/image-storage"}]},{"group":"Audience","pages":[{"title":"Audience","href":"/learn/audience/introduction"},{"title":"Contacts","href":"/learn/audience/contacts"},{"title":"Contact Lists","href":"/learn/audience/lists"},{"title":"Subscription Topics","href":"/learn/audience/topics"},{"title":"Email Preferences Page","href":"/learn/audience/email-preferences"},{"title":"Segments","href":"/learn/audience/segments"},{"title":"Importing \u0026 Exporting","href":"/learn/audience/importing-and-exporting"},{"title":"Double Opt-In","href":"/learn/audience/double-opt-in"}]},{"group":"Campaigns","pages":[{"title":"Campaigns","href":"/learn/campaigns/introduction"},{"title":"Creating a Campaign","href":"/learn/campaigns/creating-a-campaign"},{"title":"Content \u0026 Design","href":"/learn/campaigns/content-and-design"},{"title":"Audience Selection","href":"/learn/campaigns/audience-selection"},{"title":"Sending \u0026 Scheduling","href":"/learn/campaigns/sending-and-scheduling"},{"title":"Analytics \u0026 Reporting","href":"/learn/campaigns/analytics-and-reporting"}]},{"group":"Multilingual Campaigns","pages":[{"title":"Multilingual Campaigns","href":"/learn/multilingual-campaigns/introduction"},{"title":"Multilingual Templates","href":"/learn/multilingual-campaigns/template-languages"},{"title":"Template Translation","href":"/learn/multilingual-campaigns/template-translation"},{"title":"How Template Languages Work","href":"/learn/multilingual-campaigns/how-template-languages-work"},{"title":"Contact Language","href":"/learn/multilingual-campaigns/contact-language"},{"title":"Campaign Setup","href":"/learn/multilingual-campaigns/campaign-setup"},{"title":"Sending and Results","href":"/learn/multilingual-campaigns/sending-and-results"}]},{"group":"Webhooks","pages":[{"title":"Webhooks","href":"/learn/webhooks/introduction"},{"title":"Event Types","href":"/learn/webhooks/event-types"},{"title":"Handling Webhooks","href":"/learn/webhooks/handling"},{"title":"Authorization","href":"/learn/webhooks/authorization"},{"title":"Retries","href":"/learn/webhooks/retries"},{"title":"Testing Webhooks","href":"/learn/webhooks/testing"}]},{"group":"Events","pages":[{"title":"Email Events","href":"/learn/events/introduction"},{"title":"Event Types","href":"/learn/events/event-types"},{"title":"Message Details","href":"/learn/events/message-details"}]},{"group":"Logs","pages":[{"title":"API Logs","href":"/learn/logs/introduction"},{"title":"Filtering and Searching","href":"/learn/logs/filtering-and-searching"},{"title":"Status Codes","href":"/learn/logs/status-codes"}]},{"group":"Analytics","pages":[{"title":"Analytics","href":"/learn/analytics/introduction"},{"title":"Reading the Dashboard","href":"/learn/analytics/reading-the-dashboard"},{"title":"Filtering and Breakdowns","href":"/learn/analytics/filtering-and-breakdowns"}]},{"group":"MCP","pages":[{"title":"MCP for AI Assistants","href":"/learn/mcp/introduction"},{"title":"Remote Server","href":"/learn/mcp/setup"},{"title":"Connect with an API Key","href":"/learn/mcp/api-key-auth"},{"title":"Local Server (deprecated)","href":"/learn/mcp/local-setup"},{"title":"Tools Reference","href":"/learn/mcp/tools-reference"}]},{"group":"Settings","pages":[{"title":"Dashboard","href":"/learn/settings/dashboard"},{"title":"Onboarding","href":"/learn/settings/onboarding"},{"title":"Profile \u0026 Appearance","href":"/learn/settings/profile"},{"title":"Team Management","href":"/learn/settings/teams"},{"title":"Account Security","href":"/learn/settings/security"},{"title":"Social Login (OAuth)","href":"/learn/settings/social-login"},{"title":"Billing","href":"/learn/settings/billing"},{"title":"Monitoring \u0026 Alerts","href":"/learn/settings/alerts"},{"title":"Notification Center","href":"/learn/settings/notifications"}]}]},{"group":"Integrations","pages":[{"title":"Introduction","href":"/integrations/introduction"},{"title":"Stripe Email Integration","href":"/integrations/stripe"},{"title":"Supabase","href":"/integrations/supabase"},{"title":"WordPress","href":"/integrations/wordpress"},{"title":"Zapier Email Automation","href":"/integrations/zapier"}]},{"group":"Resources","pages":[{"title":"Official Lettr SDKs","href":"/resources/sdks"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"Knowledge Base","pages":[{"title":"Knowledge Base","href":"/knowledge-base/introduction"}]}]},"basePath":"","title":"Using Templates - Lettr","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}