Creating a reusable email layout

Email layouts are reusable wrappers around your email content. They let you define global structure — header, footer, typography, and brand styling — once, then apply it to any email message or template.

What an email layout is

An email layout is HTML that surrounds your message body. Think of it as the “frame” that holds your email content.

Layouts are especially useful for:

  • Consistent branding (logo, colors, spacing)
  • Shared footer content (legal text, unsubscribe/help links)
  • Consistent typography and spacing

The {{content}} placeholder

Your layout must have a placeholder where ChimeKit will inject the email body:

  • {{content}} (or {{{content}}})

Anywhere else in your layout, you can use normal variables like {{companyName}} or {{supportUrl}}.

Create a layout in the Dashboard

  1. Go to Email settings → Layouts.
  2. Create a new layout with a stable key (for example default or marketing).
  3. Build your HTML wrapper and include {{content}} in the body.
  4. Publish the layout. Optionally mark it as the default layout for the environment.

Apply a layout to email content

There are two common ways layouts get applied:

  • By default: if you mark a layout as default, emails can use it automatically.
  • Explicitly: set a layoutId when sending an email message or when defining email template content.

Apply via Server SDK (manual email send)

@chimekit/node

import { ChimeKit } from "@chimekit/node";

const ck = new ChimeKit({ secretKey: process.env.CHIMEKIT_SECRET_KEY! });

await ck.messages.sendMessage("user_123", {
  content: {
    email: {
      title: "Welcome to ChimeKit",
      body: "Thanks for signing up, {{firstName}}.",
      layoutId: "layout_default",
      variables: { firstName: "Ava" },
    },
  },
});

Practical tips

  • Keep layout HTML simple: email clients are less forgiving than browsers.
  • Put styles inline where possible (many clients strip <style> blocks).
  • Include preview/snippet-friendly content near the top of the email body.
  • Prefer layouts for shared structure, and templates for reusable message content.

Next steps

Was this page helpful?