Template tags
Four tags. None of them require JavaScript.
{exp:wrangler:submit_form}
Wraps its own tag pair in a form that opens a ticket. You write the inputs; the tag supplies the <form> element, the CSRF token, a honeypot, and a signed render timestamp.
| Parameter | Purpose |
|---|---|
return= |
Template path to land on after a successful submit. Must be site-relative. |
class= / id= |
Attributes for the <form> element. |
| Variable | Value |
|---|---|
{error_message} |
Why the last attempt failed. Empty otherwise. |
{if error} |
True when the last attempt failed. |
{subject} / {message} |
Sticky values from a failed attempt. |
{name} / {email} |
Sticky guest contact details from a failed attempt. Empty for members. |
{selected_queue} |
The queue chosen on a failed attempt. |
{if has_queues} |
True when at least one queue is configured. |
{queues} |
Variable pair over the configured queues. Each row has {queue} and {if is_selected}. |
{if logged_in} / {if logged_out} |
Whether a member is signed in. |
{if needs_contact_info} |
True when name and email inputs should be shown. |
{if allow_guest_tickets} |
The current setting. |
Recognised inputs: subject and message (required); name and email (required for guests); priority and queue (optional, validated against your settings); and any input named meta:something, which is stored on the ticket and shown to staff in the meta header.
Building the queue dropdown
The posted queue has to match a configured queue exactly — same spelling, case and spacing. A value that does not match is dropped silently: the ticket is still created, just with no queue and no error. Hardcoding the options therefore means a queue renamed in settings quietly stops categorising new tickets.
Use the {queues} pair instead and both sides come from one source:
{if has_queues}
<label for="wr-queue">What is this about?</label>
<select id="wr-queue" name="queue">
<option value="">Choose one…</option>
{queues}
<option value="{queue}"{if is_selected} selected{/if}>{queue}</option>
{/queues}
</select>
{/if}
Rename a queue in settings and the dropdown follows on the next page load, with no template edit. {if is_selected} keeps the visitor's choice through a rejected submission.
This is how to model products you support: name the queues after your products, and every ticket arrives already filed against one. Queue is a sortable column and a filter in the control panel, so staff can work a single product at a time. If you also need a version, keep the product in the queue and add a meta:version input alongside it.
If guest tickets are switched off and nobody is signed in, the tag renders {if no_results}.
{exp:wrangler:ticket}
One ticket, for whoever is authorized to see it.
| Parameter | Purpose |
|---|---|
reference= |
Which ticket to load. Used for signed-in members; ignored for token holders, because a token already names exactly one ticket. |
token= |
The raw magic-link token, normally the URL segment after the reference. |
Top-level variables: {reference} {subject} {status} {status_label} {priority} {priority_label} {queue} {requester_name} {requester_email} {created_at} {last_message_at} {message_count}, the conditionals {if is_open} and {if is_closed}, and one {meta:key} per key stored on the ticket.
Date variables accept EE formatting, e.g. {created_at format="%Y-%m-%d %H:%i"}.
The {messages} pair yields {author_name} {author_type} {message} {created_at} and the conditionals {if is_staff} and {if is_customer}.
Internal notes are excluded by the database query, not filtered out of the loop, so a staff note cannot reach the page even if a template does something unexpected with the data.
The tag renders {if no_results} when the requester is not authorized, when the reference is unknown, and when the token is wrong. All three look identical on purpose, so the tag cannot be used to work out which references exist.
{exp:wrangler:tickets}
A signed-in member's own tickets.
| Parameter | Default | Purpose |
|---|---|---|
status= |
— | Restrict to new, open, pending or closed. |
limit= |
20 |
Maximum rows. |
orderby= |
last_message_at |
One of created_at, updated_at, last_message_at, status, priority, subject, reference. |
sort= |
desc |
asc or desc. |
Variables per row: {reference} {subject} {status} {status_label} {priority} {priority_label} {queue} {created_at} {last_message_at} {if is_open} {if is_closed}.
This tag has no token path. A magic link grants one ticket, never an index, so a logged-out visitor holding a perfectly valid token still gets {if no_results} here.
{exp:wrangler:reply_form}
Wraps its tag pair in a form that adds a customer reply. Takes the same reference= and token= parameters as {exp:wrangler:ticket}, plus return=, class= and id=. The only input it reads is message.
Renders {if no_results} for anyone not authorized to reply. Variables: {reference} {error_message} {if error} {message} (sticky) and {if is_closed}.
{exp:wrangler:branding}
The Branding settings, for a template that wants them. Takes no parameters.
| Variable | Value |
|---|---|
{branding_css} |
A complete <style> block overriding the stylesheet's colour tokens. Empty when nothing is configured. |
{logo_url} / {if has_logo} |
The configured logo, if any. |
{brand_background} / {brand_accent} |
The raw hex values, empty when unset. |
{if is_branded} |
True when any of the three settings is set. |
The usual use is one line in <head>:
{exp:wrangler:branding}{branding_css}{/exp:wrangler:branding}
This works because every colour in the sample stylesheet routes through a custom property on :root — the tag overrides those properties rather than adding rules. Rewrite the stylesheet however you like and CP theming keeps working, as long as --wr-paper, --wr-blue and --wr-blue-lift survive. Hover states are derived from the accent, so you set one colour rather than two.
An unconfigured site emits nothing at all — not an empty <style> block — so it is safe to include unconditionally.
Do not nest this inside another Wrangler tag. EE does not parse one module tag inside another; call it separately, as the sample templates do.
A note on caching
Do not enable template caching on a page carrying either form. The CSRF token and action IDs are substituted after the cache layer so they stay correct, but the error and sticky-value variables come from flashdata and a cached page will not show them.