Add-on Documentation from JCOGS Design

VariablesLast updated: 20 January 2026

JCOGS OTP Pro exposes variables in several contexts:

  • Template tags: variables available inside tag pairs (or via output parameters)
  • Email templates: variables available when building email payloads
Template Variables

JCOGS OTP Pro template tags expose variables primarily via tag pairs. Each tag has its own variables list and examples.

Extending variables

Companion add-ons (or custom extensions) can add additional variables at delivery time via the jcogs_otp_pro_enrich_delivery_context extension hook. These variables become available to email templates when their keys are safe variable names.

Email Template Variables

JCOGS OTP Pro supports templated email content for delivery channels such as email:code. This page documents the variables available in those templates.

Syntax

Variables Reference
  • {payload} – the delivered payload string (code or link)
  • {code} – legacy alias for the OTP code (prefer {payload})
  • {payload_link} – HTML link for the payload (safe HTML in HTML templates)
  • {payload_link_long} – HTML link where the anchor text is the URL (accessibility-friendly)
  • {member_name} – member display name
  • {username} – member username
  • {member_email} – member email address (when available)
  • {site_name} – site name
  • {site_url} – site URL
  • {current_datetime} – when the payload was sent (formatted string)
  • {expiry_seconds} – time until expiry (formatted string)
  • {code_expiry_timestamp} – unix timestamp when the code/link expires (if available)
  • {transport_id} – selected delivery transport (for example email)
  • {payload_id} – selected payload type (for example code or magic_link)
  • {payload_url} – payload URL when the payload is a URL (for example magic links)
  • {magic_link_url} – magic link URL (magic link payload)
  • {magic_link_expires_at} – unix timestamp when the magic link expires (magic link payload)
  • {otp_code} – underlying OTP code (available for payloads that still carry a code)

Usage Notes

Escaping rules

Subject templates are subject-safe (line breaks removed, HTML stripped). HTML templates escape values by default; {payload_link} and {payload_link_long} are treated as safe HTML in HTML mode. Text templates do not HTML-escape values.

Usage Notes

Simple conditionals

Email templates support a minimal conditional syntax: {if payload_id == "magic_link"}...{if:else}...{/if}

Usage Notes

JCOGS OTP Pro can merge in additional variables from payload builders and from the jcogs_otp_pro_enrich_delivery_context extension hook. Only scalar/null values with safe keys (letters/numbers/underscores) are exposed to templates.