Docs/ Rules, context & knowledge

Variables

Typed, reusable {{values}} that resolve in drafts, templates, and rules.

Variables let you define a value once and reference it everywhere — drafts, templates, AI prompts, and rule conditions — so you never paste the same thing twice and every reference stays in sync.

Defining a variable

Variables live in four scopes: global (your account settings), folder (a context folder), profile (a client profile), and thread (a one-off override on a specific conversation). You reference any variable with the same syntax regardless of scope: {{variable_name}}.

Variable names are lowercase with underscores. They can hold short strings — a URL, a number, a name, a date. They are not designed for multi-paragraph content; use templates for that.

Name variables for readability

Use descriptive names that read naturally in a sentence: {{calendar_link}}, {{pricing_tier}}, {{renewal_date}}. Avoid abbreviations that will confuse you six months from now.

Built-in variables

Aiemaily resolves the following variables automatically. You don't need to define them — they are always available in any context.

VariableResolves toExample output
{{first_name}}Recipient's first name (from contact)Maya
{{name}}Recipient's full name (from contact)Maya Patel
{{date}}Today's date, locale-formattedJune 13, 2026
{{day}}Day of the week, locale-formattedSaturday
{{time}}Current local time (sender's timezone)9:41 AM

Locale-aware output

{{date}}, {{day}}, and {{time}} use your account locale and timezone settings. Recipients in different locales see the same absolute moment rendered in your locale, which is intentional — you're telling them what time it is for you.

Resolution order

When the same variable name exists at more than one scope level, the most specific scope wins. The agent resolves in this order, stopping at the first match:

  1. 1

    Thread

    A value pinned to the current conversation overrides everything. Use thread-level variables for one-off exceptions — a special price, a custom deadline — without changing your global or profile defaults.

  2. 2

    Contact

    Variables defined on an individual contact (address-level). Useful for personal details that differ from the company profile.

  3. 3

    Profile

    Variables from the active client profile (domain- or address-scoped). These are the primary source for client-specific facts like {{renewal_date}} or {{account_tier}}.

  4. 4

    Folder

    Variables set on the context folder the profile belongs to. Shared across all profiles in that folder — good for category-wide values like {{support_email}} or {{contract_type}}.

  5. 5

    Global

    Your account-level defaults. Every compose session has access to globals: your {{calendar_link}}, {{company_name}}, {{pricing_page}}, and any other values you want available everywhere.

Resolution in practice — {{renewal_date}}
Thread scopenot set
Contact scopenot set
Profile scope (acmecorp.com)2026-09-01
Folder scopenot set
Global scopenot set
→ resolves to: 2026-09-01 (from profile)

Using variables in templates and prompts

Paste {{variable_name}} anywhere in a template body, a rule condition value, or an AI prompt instruction. Variables resolve before the AI generates text, so the model sees the actual value — not the placeholder.

If a variable is referenced but has no value in any scope, the agent flags it as unresolved before sending rather than leaving a raw {{placeholder}} in your email.

Hi {{first_name}},

Just a reminder that your {{account_tier}} subscription renews on {{renewal_date}}. As always, your dedicated link is {{calendar_link}} if you'd like to talk before then.

Warm regards,

{{sender_name}}

Unresolved variables block send

If a {{placeholder}} cannot be resolved at send time, Aiemaily will stop and show you which variable is missing and at which scope it was expected. This prevents raw placeholders from reaching your recipients.

Frequently asked

Feature overview

Rules & Brain

Ready to try it?

Start free