Skip to content

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.

Letter portraitLocale en-USHTML + Jinja

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.

PathTypeExample
senderobject
sender.organizationstring"Redwater Valley Growers Cooperative"
sender.departmentstring"Procurement Office"
sender.addressstring"2140 Orchard Loop Road, Alder Springs, OR 9703…"
sender.phonestring"+1 202-555-0134"
sender.emailstring"procurement@redwatervalley.example.org"
sender.websitestring"redwatervalley.example.org"
letterobject
letter.datedate"2026-09-17"
letter.localestring"en-US"
letter.delivery_methodstring"Via email and certified mail"
letter.subjectstring"Supply agreement SA-2024-117, changes for the …"
letter.salutationstring"Dear Mr. Carvalho:"
letter.paragraphsarray<string> · 4"Thank you for your team's support throughout t…"
letter.closingstring"Sincerely,"
letter.typist_initialsstring"EVH/jmt"
recipientobject
recipient.namestring"Mr. Daniel Carvalho"
recipient.titlestring"Director of Customer Accounts"
recipient.organizationstring"Alder & Finch Packaging Co."
recipient.addressstring"655 Riverside Industrial Parkway, Suite 300 ⏎ …"
signatoryobject
signatory.namestring"Eleanor V. Hastings"
signatory.titlestring"Director of Procurement"
enclosuresarray<string> · 2"Packaging specification sheet RVG-PS-07, revis…"
ccarray<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.

data.json
{
  "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>

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"
  }
}'