Invoice and document templates in Luminous render with a "logic-less" template language (Mustache). That means you can show, hide, and fall back between fields based on whether a value is present — but you cannot write value comparisons (like "only when the total is under $5,000") directly in the template. Here's exactly what's possible and how to do it.

Show content only when a field has a value

Wrap the content in a section that opens with {{#field}} and closes with {{/field}}. It renders only when that field has a value:

{{#paymentLink}}
  <a href="{{paymentLink}}">Pay Now</a>
{{/paymentLink}}

On any invoice with no payment link, the block (and the link) simply disappears — no automation needed.

Show an "else" when a field is empty

An inverted section opens with {{^field}}. It renders only when the field is empty:

{{#notes}}{{notes}}{{/notes}}{{^notes}}No notes on this order.{{/notes}}

Fall back through several options (A, else B, else C)

You can nest inverted sections to build a fallback chain. This shows the description, or the channel SKU if there's no description, or the SKU if there's neither:

{{#description}}{{description}}{{/description}}{{^description}}{{#channelSku}}{{channelSku}}{{/channelSku}}{{^channelSku}}{{sku}}{{/channelSku}}{{/description}}

Important: numbers and money are always "present"

Amount fields (like grandTotal, subtotal, discountAmount, taxAmount) always count as present — so {{#grandTotal}} renders even when the total is $0.00. To show something only when an amount is not zero, add .raw to the field name:

{{#discountAmount.raw}}
  <div>Total Discount: {{discountAmount}}</div>
{{/discountAmount.raw}}

{{discountAmount}} still prints the nicely formatted amount; {{#discountAmount.raw}} is what tests "is this non-zero."

Use the exact field names (they're case-sensitive)

Field names use camelCase, e.g. {{invoiceNumber}}, {{grandTotal}}, {{paymentLink}}, {{dueDate}}, {{customerPoNumber}}. A name with the wrong casing or underscores (e.g. {{grand_total}}) renders as blank. The placeholder picker in the template editor is the authoritative list of available fields — use it rather than guessing. Templates are edited under Manage → Templates.

What you can't do in the template (and what to do instead)

You can't write a numeric or text comparison such as "only show the payment link when the total is under $5,000" — the template language has no comparison operators. Two ways to get that behavior:

  1. Two templates + an automation rule (no code): keep one template with the block and one without, and use an automation rule to choose which invoice to send based on the order total. This works today with no engineering.
  2. Ask Luminous to add a condition flag: for a recurring need, Luminous can add a true/false field for your rule (for example, a showPaymentLink flag computed from the total) that you then switch on with {{#showPaymentLink}} ... {{/showPaymentLink}}. This is a small change on our side — reach out to support if you'd like it.

If you're hitting a specific conditional need, contact support with the rule you want and we'll point you to the cleanest option.