Skip to main content

Email Template Tags and Database Field Substitution

A template tag is a placeholder you drop into an email template that gets replaced with real data when the email is actually sent. Instead of typing a researcher's name or an item title by hand, you insert a tag like <#User.FirstName> or <#Request.ItemTitle>, and Aeon fills in the live value for that specific user or request at send time. This is what lets one Cancellation Notice template greet every researcher by name and quote the exact request they asked about.

Tags are written into a template once, in the Email Templates editor (under the Customization Manager). After that, day-to-day staff never touch them — they just pick the template, and the finished, filled-in email is what they see and send. Working with tags is therefore an Admin/Customizer task: you're editing the template, not sending mail.

When you'll use this
  • You're building or editing a template and want it to include data from the database — the patron's name, the item title, a call number, an appointment time, a balance due — rather than fixed text.
  • You're troubleshooting a template that's sending blank or wrong values, and you need to confirm a tag points at the right table and field.
  • You're adding a custom field you defined elsewhere to an email — custom fields appear as tags too.

What a tag looks like

Every tag follows the same shape:

<#Category.FieldName>

The <#> wrapper marks it as a tag; the part inside is Category.FieldName. A few real examples:

TagFills in
<#User.FirstName>The user's first name
<#User.FirstOrPreferredName>The user's preferred name if they set one, otherwise their first name
<#Request.ItemTitle>The title of the requested item
<#Request.CallNumber>The item's call number
<#Request.TransactionNumber>The request number (for example, 12345)
<#Appointment.StartTime>The appointment's start time
<#Billing.BalanceDue>The outstanding balance on the request

In the body editor, anything written as a <#...> tag is shown in blue bold so you can pick the tags out from your regular text at a glance.

Tags are case- and spelling-sensitive

A tag only resolves if Category.FieldName matches a real table and column. The safe way to add one is to insert it from the Template Variables panel (below) rather than typing it by hand — that guarantees the category prefix and field name are exactly right.

Which tags are available depends on the template type

Aeon has four template types — Transaction, User, Activity, and Appointment — and each type can reach a different set of data. A User template is about a person, so it can't quote an item title; a Transaction template is about a request, so it can reach almost everything. The Template Variables panel automatically shows only the categories that make sense for the type you're editing, so you can't accidentally insert a tag that will never have a value.

Template typeTag categories available
TransactionSystem, User, Researcher, Request, Queue, Photoduplication Queue, Billing, Appointment (plus any custom-field categories)
UserSystem, User (plus User custom fields)
ActivitySystem, User, Activity (plus User and Activity custom fields)
AppointmentSystem, User, Appointment (plus User custom fields)

A few notes on what the categories mean:

  • System — site contact details (your reading room's name, phone, email, address, and so on). Available in every template type.
  • User vs. Researcher — on a Transaction template, User is the logged-in account that owns the request, while Researcher is the person the request was placed for (these differ when a proxy submits on someone's behalf). On non-Transaction types there's just User.
  • Queue and Photoduplication Queue — fields from the request's current queue and its photoduplication queue.
  • Billing — computed amounts: Invoice Total, Payments, and Balance Due.
  • Appointment — appointment fields plus a few reading-room values (Reading Room Name, Reading Room Description, Min/Max Appointment Length).
  • Custom Fields — any custom field definitions you've created for users, requests, or activities show up as their own category (for example, Request Custom Fields) and can be inserted just like built-in tags.
The tag list is read live from your database

The fields offered in each category are pulled from your actual database tables, not a fixed list — so any columns specific to your site, and any custom fields you've defined, appear automatically. If you add a custom field and don't see it, use the refresh control at the top of the Template Variables panel to reload.

Inserting a tag

Tags are inserted from the Template Variables panel, which sits along the right side of the Email Templates editor on wide screens.

  1. Open the Customization Manager and go to Email Templates.
  2. Select the template you want to edit (or start a new one). For this example, open the Cancellation Notice transaction template.
  3. Confirm the Type field — the Template Variables panel updates to match it. If you change the Type, the available tags change with it.
  4. Click into the field you want the tag to land in — any of the address/header fields (Recipient Name, Subject, From Address, and so on) or the Body editor. The last field you clicked is where the tag goes.
  5. In the Template Variables panel, expand the category you need (for example, Request) and find the field (for example, Item Title).
  6. Click the tag to drop it in at your cursor, or drag it from the panel and release it where you want it. Either way the full <#Request.ItemTitle> token is inserted for you.
  7. Click Save (or press Ctrl+S / ⌘S) when you're done.

The panel footer reminds you of the two insert methods: "Drag or click a tag to insert it into the focused field." In the panel, each tag shows its friendly name (for example, Item Title); the underlying token (<#Request.ItemTitle>) is what gets written into the template.

Tags work in the header fields too, not just the body

You can put a tag in the Subject ("Your request #<#Request.TransactionNumber>"), the Recipient Name, or the From Address/CC/BCC lines — anywhere static text is allowed. A common pattern is <#User.FirstOrPreferredName> in the Recipient Name line so the email is addressed personally.

Moving between panels with the keyboard

Press F6 to cycle focus forward through the editor's three panels — the template list, the editor fields, and the Template Variables panel — and Shift+F6 to cycle backward. This lets you reach the tag list and insert from it without leaving the keyboard.

How substitution happens at send time

You insert tags into the template. The substitution into real values happens later, automatically, when an email is generated from that template — either by a staff action (cancelling a request, confirming an appointment, and so on) or by a routing rule. At that point Aeon reads the relevant record and swaps each <#...> tag for its value.

Because the tag is resolved against whichever record triggered the email, the same template produces a different, correct email every time:

  • The Cancellation Notice sent for request #12345 quotes that item's title and that researcher's name.
  • The same template sent for request #67890 quotes #67890's details instead.

You don't see this happen in the template editor — the editor always shows the raw <#...> tags. To see a tag filled in, you preview or send the email itself. (Staff who send email can review and edit the finished, substituted email before it goes out — see Email Preview Before Sending.)

A tag with no underlying value comes out blank

If a tag points at a field that's empty for a given record — say <#Request.CallNumber> on a request that never got a call number — the email shows nothing in that spot rather than the literal tag. Write surrounding text so a missing value still reads cleanly, and avoid building tags by hand where a typo would silently produce a blank.

Permissions
  • Viewing the available tags in the Template Variables panel only requires being signed in — there's no separate gate on the tag list itself.
  • Saving a template with tags in it (creating, editing, or deleting a template) requires the Integrations configuration capability. Without it, you can open and read templates but the editor's save/create/delete actions aren't available to you.
  • System templates are protected: you can insert tags and edit their content and body, but they can't be renamed or deleted.
Editor review — remove this callout (and the HTML comment below it) before publishing

A few things an SME should confirm on this page:

  • Audience framing: this page treats tags as an Admin/Customizer authoring task (matching the inventory). Confirm that's how your sites think about it, vs. presenting it as general staff knowledge.
  • Substitution-at-send wording: confirm that all tag categories listed are actually substituted at send time (the panel offers them; this page assumes the send-time engine fills every category it lists). Flag any category that's display-only or known not to resolve.
  • Blank-on-missing-value behavior: confirm an unmatched/empty tag renders as blank (not as the literal <#...> text) — stated here as a gotcha but worth an SME nod.
  • Screenshot needed: the Email Templates editor with the Template Variables panel open, a category expanded, and a tag visible in the body (showing the blue-bold tag styling).

The full generation metadata — sources, files read, and verifications, i.e. the detail a tool like Claude would need to regenerate this page — is in the HTML comment directly below this callout. When this page has been reviewed and approved, delete both this callout and that comment; a page with no Editor-review callout is one that's done.