8.5 × 11 in
Letters
Formal business letter
A US Letter business letter in full block format below a centred letterhead. It covers the date, delivery notation, inside address, a Re: line, paragraphs from an array and a signature block, with enclosures and cc lists printed only when provided.
Opens Dynamic Document API with this template preloaded in a free workspace.
Template language features
- Loops
- Conditionals
- Filters
- Date formatting
Filters such as format_currency and qrcode are described in the template language reference.
Variables
Derived from the sample data: 6 top-level fields, 26 paths in total. Send the same shape as data.
| Path | Type | Example |
|---|---|---|
| sender | object | |
| sender.organization | string | "Redwater Valley Growers Cooperative" |
| sender.department | string | "Procurement Office" |
| sender.address | string | "2140 Orchard Loop Road, Alder Springs, OR 9703…" |
| sender.phone | string | "+1 202-555-0134" |
| sender.email | string | "procurement@redwatervalley.example.org" |
| sender.website | string | "redwatervalley.example.org" |
| letter | object | |
| letter.date | date | "2026-09-17" |
| letter.locale | string | "en-US" |
| letter.delivery_method | string | "Via email and certified mail" |
| letter.subject | string | "Supply agreement SA-2024-117, changes for the …" |
| letter.salutation | string | "Dear Mr. Carvalho:" |
| letter.paragraphs | array<string> · 4 | "Thank you for your team's support throughout t…" |
| letter.closing | string | "Sincerely," |
| letter.typist_initials | string | "EVH/jmt" |
| recipient | object | |
| recipient.name | string | "Mr. Daniel Carvalho" |
| recipient.title | string | "Director of Customer Accounts" |
| recipient.organization | string | "Alder & Finch Packaging Co." |
| recipient.address | string | "655 Riverside Industrial Parkway, Suite 300 ⏎ …" |
| signatory | object | |
| signatory.name | string | "Eleanor V. Hastings" |
| signatory.title | string | "Director of Procurement" |
| enclosures | array<string> · 2 | "Packaging specification sheet RVG-PS-07, revis…" |
| cc | array<string> · 2 | "Dana Whitfield, Operations Manager, Redwater V…" |
Sample data
Fictional records used for previews. Replace them with your own data when you call the API.
{
"sender": {
"organization": "Redwater Valley Growers Cooperative",
"department": "Procurement Office",
"address": "2140 Orchard Loop Road, Alder Springs, OR 97031",
"phone": "+1 202-555-0134",
"email": "procurement@redwatervalley.example.org",
"website": "redwatervalley.example.org"
},
"letter": {
"date": "2026-09-17",
"locale": "en-US",
"delivery_method": "Via email and certified mail",
"subject": "Supply agreement SA-2024-117, changes for the 2027 season",
"salutation": "Dear Mr. Carvalho:",
"paragraphs": [
"Thank you for your team's support throughout the 2026 harvest. As we prepare for the 2027 season, I am writing to confirm two changes to the packaging and deliveries covered by our supply agreement.",
"From January 11, 2027, our member orchards will switch from 40-pound corrugated cases to 30-pound cases with reinforced hand holds. The enclosed specification sheet lists the new dimensions, board grade and print layout. Our forecast volumes are unchanged once converted to the smaller case size.",
"We would also like to combine the separate deliveries to our north and south packing sheds into a single Tuesday delivery to the north shed, where we have added dock space. The revised delivery calendar shows the proposed dates through June.",
"Please let me know by October 15, 2026, whether these changes affect pricing or lead times. I would be glad to meet during the week of October 5 to talk them through. We value our partnership and look forward to another successful season."
],
"closing": "Sincerely,",
"typist_initials": "EVH/jmt"
},
"recipient": {
"name": "Mr. Daniel Carvalho",
"title": "Director of Customer Accounts",
"organization": "Alder & Finch Packaging Co.",
"address": "655 Riverside Industrial Parkway, Suite 300\nTacoma, WA 98421"
},
"signatory": {
"name": "Eleanor V. Hastings",
"title": "Director of Procurement"
},
"enclosures": [
"Packaging specification sheet RVG-PS-07, revision C",
"Revised delivery calendar, January to June 2027"
],
"cc": [
"Dana Whitfield, Operations Manager, Redwater Valley Growers Cooperative",
"Luis Carrasco, Quality Assurance Lead, Alder & Finch Packaging Co."
]
}Source
The body markup with Jinja, the stylesheet placed in <head>.
{#- Formal business letter in full block format: every element starts at the left margin below a
centred letterhead. Paragraphs come from an array; the delivery notation, typist initials,
enclosures and cc lists only appear when they are present in the data. -#}
{%- set locale = letter.locale | default("en-US") -%}
<header class="letterhead">
<svg class="emblem" viewBox="0 0 40 40" aria-hidden="true">
<circle cx="20" cy="20" r="19" fill="none" stroke="#7a4b24" stroke-width="1.2"/>
<path d="M20 31c-6.5 0-9.5-5-9.5-10 0-4.2 2.7-7.5 6.2-7.5 1.4 0 2.4.4 3.3 1 .9-.6 1.9-1 3.3-1 3.5 0 6.2 3.3 6.2 7.5 0 5-3 10-9.5 10z" fill="#7a4b24"/>
<path d="M20 14.5c0-3 1.2-5.2 3.5-6.5" fill="none" stroke="#7a4b24" stroke-width="1.4" stroke-linecap="round"/>
<path d="M21.5 10.5c2.5-2.2 5.5-2.2 7.5-.8-2.3 2-5 2.4-7.5.8z" fill="#5f7a3d"/>
</svg>
<p class="org-name">{{ sender.organization }}</p>
<p class="org-contact">
{{ sender.department }} · {{ sender.address }}<br>
{{ sender.phone }} · {{ sender.email }} · {{ sender.website }}
</p>
</header>
<article class="letter">
<p class="date">{{ letter.date | format_date("long", locale) }}</p>
{% if letter.delivery_method %}<p class="notation">{{ letter.delivery_method | upper }}</p>{% endif %}
<p class="inside-address">
{{ recipient.name }}<br>
{% if recipient.title %}{{ recipient.title }}<br>{% endif %}
{{ recipient.organization }}<br>
{{ recipient.address | nl2br }}
</p>
{% if letter.subject %}<p class="subject"><span>Re:</span> {{ letter.subject }}</p>{% endif %}
<p class="salutation">{{ letter.salutation }}</p>
{% for paragraph in letter.paragraphs %}
<p class="paragraph{% if loop.last %} last{% endif %}">{{ paragraph }}</p>
{% endfor %}
<div class="sign-block">
<p>{{ letter.closing }}</p>
<div class="signature-space"></div>
<p class="signer">{{ signatory.name }}</p>
<p>{{ signatory.title }}</p>
</div>
{% if letter.typist_initials %}<p class="annotation">{{ letter.typist_initials }}</p>{% endif %}
{% if enclosures %}
<div class="annotation">
<p>{{ "Enclosures" if enclosures | length > 1 else "Enclosure" }} ({{ enclosures | length }})</p>
<ol>
{% for enclosure in enclosures %}<li>{{ enclosure }}</li>{% endfor %}
</ol>
</div>
{% endif %}
{% if cc %}
<div class="annotation cc">
<span class="cc-label">cc:</span>
<span class="cc-list">{% for person in cc %}{{ person }}{% if not loop.last %}<br>{% endif %}{% endfor %}</span>
</div>
{% endif %}
</article><title>{% if letter.subject %}{{ letter.subject }}{% else %}Letter from {{ sender.organization }}{% endif %}</title>
<style>
:root {
--ink: #221e1a;
--muted: #6d6358;
--umber: #7a4b24;
--sage: #5f7a3d;
--rule: #d8cfc4;
}
* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body {
margin: 0;
color: var(--ink);
font-family: "Noto Serif", "Liberation Serif", Georgia, serif;
font-size: 10pt;
line-height: 1.4;
}
p { margin: 0; }
/* Centred letterhead */
.letterhead { text-align: center; padding-bottom: 3mm; border-bottom: 0.9mm double var(--umber); }
.emblem { display: block; width: 8mm; height: 8mm; margin: 0 auto 1mm; }
.org-name {
font-family: "Montserrat", "Liberation Sans", Arial, sans-serif; font-size: 12pt; font-weight: 600;
letter-spacing: 0.2em; text-transform: uppercase; color: var(--umber);
}
.org-contact { margin-top: 1mm; font-family: "Montserrat", "Liberation Sans", Arial, sans-serif; font-size: 7pt; line-height: 1.5; letter-spacing: 0.02em; color: var(--muted); }
/* Full block format: everything aligned left */
.letter { margin-top: 7mm; }
.date { margin-bottom: 3.5mm; }
.notation { margin-bottom: 3.5mm; font-size: 8.5pt; letter-spacing: 0.08em; }
.inside-address { margin-bottom: 4.5mm; }
.subject { margin-bottom: 4mm; font-weight: 700; }
.subject span { color: var(--umber); }
.salutation { margin-bottom: 3mm; }
.paragraph { margin-bottom: 3mm; text-align: left; }
.paragraph.last { margin-bottom: 4.5mm; }
.sign-block { break-inside: avoid; page-break-inside: avoid; }
.signature-space { height: 13mm; }
.signer { font-weight: 700; }
.annotation { margin-top: 3.5mm; font-size: 8.5pt; line-height: 1.4; }
.annotation ol { margin: 0.5mm 0 0; padding-left: 5mm; }
.cc { display: flex; gap: 2mm; }
.cc-label { flex: none; }
</style>Render it with the API
After adding the template to your workspace, render it by ID and pass your data. Arrays are shortened here.
curl -X POST https://api-eu.dynamicdocumentapi.com/v1/renders \
-H "Authorization: Bearer $DYNAMIC_DOCUMENT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"input": {
"type": "template",
"template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C"
},
"data": {
"sender": {
"organization": "Redwater Valley Growers Cooperative",
"department": "Procurement Office",
"address": "2140 Orchard Loop Road, Alder Springs, OR 97031",
"phone": "+1 202-555-0134",
"email": "procurement@redwatervalley.example.org",
"website": "redwatervalley.example.org"
},
"letter": {
"date": "2026-09-17",
"locale": "en-US",
"delivery_method": "Via email and certified mail",
"subject": "Supply agreement SA-2024-117, changes for the 2027 season",
"salutation": "Dear Mr. Carvalho:",
"paragraphs": [
"Thank you for your team'\''s support throughout the 2026 harvest. As we prepare for the 2027 season, I am writing to confirm two changes to the packaging and deliveries covered by our supply agreement.",
"From January 11, 2027, our member orchards will switch from 40-pound corrugated cases to 30-pound cases with reinforced hand holds. The enclosed specification sheet lists the new dimensions, board grade and print layout. Our forecast volumes are unchanged once converted to the smaller case size."
],
"closing": "Sincerely,",
"typist_initials": "EVH/jmt"
},
"recipient": {
"name": "Mr. Daniel Carvalho",
"title": "Director of Customer Accounts",
"organization": "Alder & Finch Packaging Co.",
"address": "655 Riverside Industrial Parkway, Suite 300\nTacoma, WA 98421"
},
"signatory": {
"name": "Eleanor V. Hastings",
"title": "Director of Procurement"
},
"enclosures": [
"Packaging specification sheet RVG-PS-07, revision C",
"Revised delivery calendar, January to June 2027"
],
"cc": [
"Dana Whitfield, Operations Manager, Redwater Valley Growers Cooperative",
"Luis Carrasco, Quality Assurance Lead, Alder & Finch Packaging Co."
]
},
"output": {
"format": "pdf",
"filename": "letter-business-formal.pdf"
}
}'const response = await fetch("https://api-eu.dynamicdocumentapi.com/v1/renders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DYNAMIC_DOCUMENT_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
"input": {
"type": "template",
"template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C"
},
"data": {
"sender": {
"organization": "Redwater Valley Growers Cooperative",
"department": "Procurement Office",
"address": "2140 Orchard Loop Road, Alder Springs, OR 97031",
"phone": "+1 202-555-0134",
"email": "procurement@redwatervalley.example.org",
"website": "redwatervalley.example.org"
},
"letter": {
"date": "2026-09-17",
"locale": "en-US",
"delivery_method": "Via email and certified mail",
"subject": "Supply agreement SA-2024-117, changes for the 2027 season",
"salutation": "Dear Mr. Carvalho:",
"paragraphs": [
"Thank you for your team's support throughout the 2026 harvest. As we prepare for the 2027 season, I am writing to confirm two changes to the packaging and deliveries covered by our supply agreement.",
"From January 11, 2027, our member orchards will switch from 40-pound corrugated cases to 30-pound cases with reinforced hand holds. The enclosed specification sheet lists the new dimensions, board grade and print layout. Our forecast volumes are unchanged once converted to the smaller case size."
],
"closing": "Sincerely,",
"typist_initials": "EVH/jmt"
},
"recipient": {
"name": "Mr. Daniel Carvalho",
"title": "Director of Customer Accounts",
"organization": "Alder & Finch Packaging Co.",
"address": "655 Riverside Industrial Parkway, Suite 300\nTacoma, WA 98421"
},
"signatory": {
"name": "Eleanor V. Hastings",
"title": "Director of Procurement"
},
"enclosures": [
"Packaging specification sheet RVG-PS-07, revision C",
"Revised delivery calendar, January to June 2027"
],
"cc": [
"Dana Whitfield, Operations Manager, Redwater Valley Growers Cooperative",
"Luis Carrasco, Quality Assurance Lead, Alder & Finch Packaging Co."
]
},
"output": {
"format": "pdf",
"filename": "letter-business-formal.pdf"
}
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const result = await response.json();
console.log(result);import os
import uuid
import requests
response = requests.post(
"https://api-eu.dynamicdocumentapi.com/v1/renders",
headers={
"Authorization": f"Bearer {os.environ['DYNAMIC_DOCUMENT_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"input": {
"type": "template",
"template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C",
},
"data": {
"sender": {
"organization": "Redwater Valley Growers Cooperative",
"department": "Procurement Office",
"address": "2140 Orchard Loop Road, Alder Springs, OR 97031",
"phone": "+1 202-555-0134",
"email": "procurement@redwatervalley.example.org",
"website": "redwatervalley.example.org",
},
"letter": {
"date": "2026-09-17",
"locale": "en-US",
"delivery_method": "Via email and certified mail",
"subject": "Supply agreement SA-2024-117, changes for the 2027 season",
"salutation": "Dear Mr. Carvalho:",
"paragraphs": ["Thank you for your team's support throughout the 2026 harvest. As we prepare for the 2027 season, I am writing to confirm two changes to the packaging and deliveries covered by our supply agreement.", "From January 11, 2027, our member orchards will switch from 40-pound corrugated cases to 30-pound cases with reinforced hand holds. The enclosed specification sheet lists the new dimensions, board grade and print layout. Our forecast volumes are unchanged once converted to the smaller case size."],
"closing": "Sincerely,",
"typist_initials": "EVH/jmt",
},
"recipient": {
"name": "Mr. Daniel Carvalho",
"title": "Director of Customer Accounts",
"organization": "Alder & Finch Packaging Co.",
"address": "655 Riverside Industrial Parkway, Suite 300\nTacoma, WA 98421",
},
"signatory": {
"name": "Eleanor V. Hastings",
"title": "Director of Procurement",
},
"enclosures": ["Packaging specification sheet RVG-PS-07, revision C", "Revised delivery calendar, January to June 2027"],
"cc": ["Dana Whitfield, Operations Manager, Redwater Valley Growers Cooperative", "Luis Carrasco, Quality Assurance Lead, Alder & Finch Packaging Co."],
},
"output": {
"format": "pdf",
"filename": "letter-business-formal.pdf",
},
},
timeout=90,
)
response.raise_for_status()
print(response.json())