How to Edit Email Templates
Both Default and Custom email templates can be edited to customize the look and feel of almost any email sent from the Capacity Platform. Editing templates requires knowledge of HTML code, Capacity variables, and some simple templating language.
To help Admins learn how to create or edit templates, as well as safely test those templates, this article will discuss…
- Important Warnings
- HTML Email General Knowledge
- How to Edit Default Templates
- How to Create Custom Email Templates
- How to Safely Test Email Templates
- How to Use Variables
- Global Variables
- Helpdesk Variables
- How to Use Templating Language
- How to Use AI to Make Custom Templates
Important Warnings
With great power comes great responsibility! Changing or overriding Default templates can have consequences beyond just the look and feel of emails sent from the Capacity platform. Know these consequences below before editing Default templates, or overriding them with Custom templates.
Always Test First!
Read the “How to Safely Test Email Templates” section before making any changes to Default or Custom email templates.
The Helpdesk Subject Matters for Threading Replies
“Threading” the replies of an email chain together is a complex process. One requirement for threading a reply is that the email subject of a reply is the same as all other emails on the thread. Editing the subject of Default or Custom template can cause replies to no longer thread on the same conversation.
Before changing the subject for a Default or Custom template, be aware it may impact active Helpdesk conversations and result in new tickets for mid-conversation threads.
Templating Language
The Default templates serve as an always available example of how email templates need to be built. That includes the “templating language” which can be found especially in Helpdesk
Some “templating language” is required for emails to function like the line {%- autoescape false -%}.
If you have trouble understanding the templating language, or where it should be included, please reach out to your customer support representative.
HTML Email General Knowledge
Generally, any email that includes any kind of styling or structure outside of plain text utilizes HTML code to create the look and feel of that email. Most people have heard of HTML and know that it is the language that powers the Web.
In theory, you could use the same HTML that is used to design a beautiful web page to design a beautiful HTML email. In practice, email clients like Outlook, Gmail, etc. do not have the same “support” for HTML as a web browser like Chrome or Safari.
To successfully edit the look and feel of your emails in Capacity, you will need to ensure you build HTML emails in a way that is supported by regular email clients. That means using limited HTML, like “tables” tags. In the past that might have been a tall order for someone without coding experience, but with the help of AI, it’s possible for almost anyone to make the email they desire. Just be sure to always test thoroughly before making changes, especially to Default templates.
How to Edit Default Templates
At this time 11/03/2025, specifically "Agent Reply" and "Agent Forward" templates can only be "overridden" using Custom templates. This documentation will be updated when the Default template changes are accepted in the future.
Default templates define the Subject and the HTML code being used for emails sent from the Capacity platform. Default templates include:
- Agent Reply - Replies sent from a ticket or a forward thread.
- Agent Forward - The initial forward email on an email thread.
- Simple Response - Automated simple responses to Helpesk emails received.
- KB Suggestion - Automated Knowledge base suggestion responses to Helpdesk emails received.
- Autopilot - Automated Autopilot email responses to Helpesk emails received.
- Broadcast - Emails sent from Broadcast steps in Automations, Workflows, and Guided Conversations
To edit these HTML code for Default templates, Admin role users can go to the Settings > Email Template link on the “Settings” page under the “Email” section of the navigation sidebar. The user should then see the table of “Default Templates”. Click the row of the Default template you wish to edit to arrive on the template edit page.
Template Edit Page
The Default template edit page will let the user edit the following.
- Subject
- HTML Template
- Plain Text Template - Only applicable to Helpdesk emails
All three fields include the variables dropdown. Click the lightning bolt icon to add variables that will populate when the email is sent. Global variables will work with any template. Helpdesk variables will only work with Helpdesk category Default templates. To learn more about each variable and what they are replaced with, go to the “How to Use Variables” section below.
Edit the HTML code in the “HTML Template” field to change anything you want about your email templates. Default templates are a great example for how email code should be structured. Tags like the table tage, i.e. <table></table>, are commonly used and supported by popular email clients.
Default templates are also a great example of how variables and the “templating language” are used. To learn more about variables or the templating language, go to the sections on those topics below.
Restoring Default Template Code
While templates do not have “versioning”, edited Default templates can be “restored” to the original template code if necessary using the “Restore Default HTML” option.
Please note: restoring a Default template “HTML Template” field does not restore the subject line. You must manually revert any changes to the Subject field.
Previewing Templates
Edits to Default or Custom email templates can also be previewed using the Preview button below the HTML Template field. The preview will show HTML structure and style, but variables will not be populated because they are filled in when the email is sent.
How to Create Custom Email Templates
To create a Custom email template, an Admin may
- Make a copy of a Default or Custom template using the “copy” icon
- Use the “Create Template” button to create a template from scratch
We always recommend using the Default templates as an example and starting point when creating a custom template.
The copy or the newly created template can then be edited by clicking the row of the template in the table in the“Custom Template” tab.
The Custom template edit page is the same as the Default template edit page with one exception. Custom templates have the option to edit the name of the template so it can be easily found when overriding a default or when assigning for use in a Broadcast step.
How to Safely Test Email Templates
Changes made to Default email templates immediately affect all emails being sent from the platform that are using those templates. Do NOT test changes directly in your Default templates.
Instead, follow the instructions below to safely test the edits you want to make to your email templates.
Testing Helpdesk Template Changes
Follow these instructions if you want to make edits to Helpdesk Default email template
- Make a “testing” Helpdesk Project - i.e. a project where you can change the emails without fear of interrupting day to day operations
- Make a “Copy” of the template you want to edit
- Edit the Custom template copy of the Default template
- Go to the “inbox” settings page for the inbox of the test project
- Override the Default template by selecting the Custom template you edited and save the changes to the inbox settings
- Send your Agent Reply, Agent Forward, or trigger your Automated response to test the email template you have edited.
- Iterate on your Custom template as needed
- If everything looks good. Either
- Override the Projects where you want to replace the Default with the Custom template
- Or, replace the Default template code with your thoroughly tested Custom template.
Testing Global (Broadcast) Template Changes
Follow these instructions if you want to make edits to a Custom email template
- Make a “Copy” of the template you want to edit, or create a new Custom template
- Edit the copy or the new Custom template
- Create a Broadcast step in an Automation, Workflow, or Guided Conversation
- Override the Default template with the Custom template in the dropdown option
- Trigger the email via the Automation, Workflow, or GC
- Iterate on your Custom template as needed
- If everything looks good, you’re all done!
Testing Variables
If an Admin wants to test which variables are available, use the instructions above and add the code below in a “testing” Custom template to see which variables populate and what the content looks like in the specific template being tested
<div>
<h1>Output All Variables</h1>
<p><strong>content:</strong> {{content}}</p>
<p><strong>has_header_logo_enabled:</strong> {{has_header_logo_enabled}}</p>
<p><strong>org_footer_html:</strong> {{org_footer_html}}</p>
<p><strong>org_id:</strong> {{org_id}}</p>
<p><strong>org_logo_url:</strong> {{org_logo_url}}</p>
<p><strong>reply_to:</strong> {{reply_to}}</p>
<p><strong>should_include_profile_pic:</strong> {{should_include_profile_pic}}</p>
<p><strong>subject:</strong> {{subject}}</p>
<p><strong>agent_attribution:</strong> {{agent_attribution}}</p>
<p><strong>agent_name_first:</strong> {{agent_name_first}}</p>
<p><strong>agent_name_last:</strong> {{agent_name_last}}</p>
<p><strong>agent_profile_image_url:</strong> {{agent_profile_image_url}}</p>
<p><strong>agent_signature:</strong> {{agent_signature}}</p>
<p><strong>inbound_email_recipient_address:</strong> {{inbound_email_recipient_address}}</p>
<p><strong>inbound_email_stripped_text_body:</strong> {{inbound_email_stripped_text_body}}</p>
<p><strong>inbound_email_subject:</strong> {{inbound_email_subject}}</p>
<p><strong>inbox_user_uuid:</strong> {{inbox_user_uuid}}</p>
<p><strong>kb_suggestions:</strong> {{kb_suggestions}}</p>
<p><strong>kb_suggestions_feedback_url:</strong> {{kb_suggestions_feedback_url}}</p>
<p><strong>kb_suggestions_with_ticket_fallback_response:</strong> {{kb_suggestions_with_ticket_fallback_response}}</p>
<p><strong>kb_suggestions_without_ticket_fallback_response:</strong> {{kb_suggestions_without_ticket_fallback_response}}</p>
<p><strong>project_enable_private_tickets:</strong> {{project_enable_private_tickets}}</p>
<p><strong>project_enable_public_tickets:</strong> {{project_enable_public_tickets}}</p>
<p><strong>project_include_self_close_link:</strong> {{project_include_self_close_link}}</p>
<p><strong>project_key:</strong> {{project_key}}</p>
<p><strong>project_name:</strong> {{project_name}}</p>
<p><strong>project_owner_uuid:</strong> {{project_owner_uuid}}</p>
<p><strong>project_signature:</strong> {{project_signature}}</p>
<p><strong>project_status_id:</strong> {{project_status_id}}</p>
<p><strong>project_status_name:</strong> {{project_status_name}}</p>
<p><strong>project_uuid:</strong> {{project_uuid}}</p>
<p><strong>quotes:</strong> {{quotes}}</p>
<p><strong>send_kb_suggestions_and_create_ticket:</strong> {{send_kb_suggestions_and_create_ticket}}</p>
<p><strong>send_kb_suggestions_and_do_not_create_ticket:</strong> {{send_kb_suggestions_and_do_not_create_ticket}}</p>
<p><strong>ticket_assigned_user_email:</strong> {{ticket_assigned_user_email}}</p>
<p><strong>ticket_assigned_user_name_first:</strong> {{ticket_assigned_user_name_first}}</p>
<p><strong>ticket_assigned_user_name_last:</strong> {{ticket_assigned_user_name_last}}</p>
<p><strong>ticket_assigned_user_profile_image_url:</strong> {{ticket_assigned_user_profile_image_url}}</p>
<p><strong>ticket_created_at:</strong> {{ticket_created_at}}</p>
<p><strong>ticket_description:</strong> {{ticket_description}}</p>
<p><strong>ticket_due_date:</strong> {{ticket_due_date}}</p>
<p><strong>ticket_is_past_due:</strong> {{ticket_is_past_due}}</p>
<p><strong>ticket_last_transitioned_at:</strong> {{ticket_last_transitioned_at}}</p>
<p><strong>ticket_link:</strong> {{ticket_link}}</p>
<p><strong>ticket_priority_id:</strong> {{ticket_priority_id}}</p>
<p><strong>ticket_priority_name:</strong> {{ticket_priority_name}}</p>
<p><strong>ticket_public_url:</strong> {{ticket_public_url}}</p>
<p><strong>ticket_reference_number:</strong> {{ticket_reference_number}}</p>
<p><strong>ticket_reporter_email:</strong> {{ticket_reporter_email}}</p>
<p><strong>ticket_reporter_name_first:</strong> {{ticket_reporter_name_first}}</p>
<p><strong>ticket_reporter_name_last:</strong> {{ticket_reporter_name_last}}</p>
<p><strong>ticket_reporter_uuid:</strong> {{ticket_reporter_uuid}}</p>
<p><strong>ticket_self_close_url:</strong> {{ticket_self_close_url}}</p>
<p><strong>ticket_slug:</strong> {{ticket_slug}}</p>
<p><strong>ticket_status_id:</strong> {{ticket_status_id}}</p>
<p><strong>ticket_status_name:</strong> {{ticket_status_name}}</p>
<p><strong>ticket_title:</strong> {{ticket_title}}</p>
<p><strong>ticket_uuid:</strong> {{ticket_uuid}}</p>
</div>
How to Use Variables
Default and Custom email templates come with two categories of variables.
- Global
- Helpdesk
Global variables will populate and work with any template. Helpdesk variables will only populate and work with Helpdesk category emails. Check the Default templates section above for a full list of Helpdesk Default email templates.
Variable Notation in HTML Template
Throughout the Capacity platform variables are added via the variables dropdown, accessed via the “lightning bolt” icon. Added variables take on the appearance of a “chip” of varying colors, i.e. blue, magenta, green.
Less commonly understood, is that variables can also be referenced manually using a specific notation. Variables can be manually written between two sets of curly braces, i.e. {{variable_name}}
The HTML Template field exclusively uses this manual version of variable notation. Unlike the Subject field, when a user adds a variable the the HTML Template field, it will automatically add the manually written string, instead of a chip.
Variable Availability
For Helpdesk category templates, not all variables are available for all Default templates. For example, the {{quotes}} variable contains all of the “threaded” replies and responses that are part of a ticket thread. While available to add to any template, this variable will only populate for Agent Reply, and Agent Forward emails because those are the only emails that would have data for that variable.
Helpdesk Variables in Custom Templates
It is possible to add Helpdesk variables to any template, including Custom templates. However, these variables will only work if the Custom template is used to override a Default Helpdesk template.
Using a Custom template which has Helpdesk variables like “ticket_uuid” for a Broadcast step will not populate the variable when the email is sent.
Global Variables
The variable names attempt to be descriptive in the data you should expect. Below is a list of all Global variables, and explanations for each variable.
- content - content of the Helpdesk “reply” box or Broadcast step body
- has_header_logo_enabled - true/false string whether logo is enabled
- org_footer_html - HTML code defined in Org settings
- org_id - id for Organization found in URL, i.e. …/helpdesk/{org id}/tickets…
- org_logo_url - logo url
- reply_to - inbox settings reply to field for inbox from which email was sent
- should_include_profile_pic - true/false per settings
- subject - subject from Helpdesk reply box or Broadcast step subject field
Helpdesk Variables
The variable names attempt to be descriptive in the data you should expect. Note there are also many variables you may never need to learn or be familiar with. Editing template structure and style does not require adding or removing variables.
Below is a list of all Helpdesk variables, and explanations for the less obvious ones.
- agent_attribution - attribution phrase per inbox settings
- agent_name_first
- agent_name_last
- agent_profile_image_url - url for agent profile image
- agent_signature - full HTML code for agent signature
- inbound_email_recipient_address
- inbound_email_stripped_text_body
- inbound_email_subject
- inbox_user_uuid
- kb_suggestions - HTML chunk response from KB search
- kb_suggestions_feedback_url
- kb_suggestions_with_ticket_fallback_response
- kb_suggestions_without_ticket_fallback_response
- project_enable_private_tickets - true/false for private portal enabled
- project_enable_public_tickets - true/false for public portal enabled
- project_include_self_close_link - true/false for inclusion of self close link
- project_key - i.e. CS (for Customer Support)
- project_name
- project_owner_uuid
- project_signature - full HTML of project signature
- project_status_id
- project_status_name
- project_uuid
- quotes - List/array of “replies” that are part of a specific email thread. Uses templating language to “loop” through each of the replies.
- send_kb_suggestions_and_create_ticket
- send_kb_suggestions_and_do_not_create_ticket
- ticket_assigned_user_email
- ticket_assigned_user_name_first
- ticket_assigned_user_name_last
- ticket_assigned_user_profile_image_url
- ticket_created_at
- ticket_description
- ticket_due_date
- ticket_is_past_due - true/false for past due
- ticket_last_transitioned_at
- ticket_link - link to Capacity web console (use for agents, not reporters)
- ticket_priority_id
- ticket_priority_name
- ticket_public_url
- ticket_reference_number - i.e. CS-101655117
- ticket_reporter_email
- ticket_reporter_name_first
- ticket_reporter_name_last
- ticket_reporter_uuid
- ticket_self_close_url
- ticket_slug - i.e. CS-125
- ticket_status_id
- ticket_status_name
- ticket_title
- ticket_uuid
How to Use Templating Language
Default and Custom email templates leverage a “templating language” for a few specific use cases that require “code-like” behavior. Specifically:
- Forcing HTML to be used - i.e. {%- autoescape false -%} … {%- endautoescape %}
- IF statements - i.e. {% if has_header_logo_enabled %} … {% endif %} }
- IF ELSE statements - i.e. {% if has_header_logo_enabled %} ... {% else %} … {% endif %}
- FOR LOOPS - i.e. {% for quote in quotes %} … {% endfor %}
These may seem confusing for anyone unfamiliar with “coding”, but do not worry. You do not need to change sections that contain these special “templating language” syntaxes. Instead you can copy and paste “chunks” wherever you need them to be in your email template.
If you do happen to want to alter the appearance within any of these “template language” code sections, you can use the help of AI Agents, or seek help from your Helpdesk Customer Support rep.
Below are some examples of how the templating language is used in the Agent Reply Default template.
Conditional “IF” Statements
The below section conditionally adds the Organization Footer HTML if there is content in the Organization Footer in the Capacity Settings. It also conditionally shows the “powered by” section.
Conditional “IF” “ELSE” Statement
The below section conditionally adds the Organization Logo if one has been added, otherwise it defaults to another image via the “else” statement.
“FOR LOOP” Statement
The below conditionally adds the “replies” section to an Agent reply email using an IF check, then if there are replies, the “For” code “loops” through a list of {{quotes}}, much like a Workflow loops through a list, and adds a section for each “reply” that is on the thread of a ticket conversation.
The above examples can help explain how the templating language works in concert with HTML code and variables. Remember to always test your email template changes in a safe testing project!
How to use AI to make Custom Templates
Once upon a time editing the HTML code for an email template was only possible for experts in HTML and the limitations of email client support for HTML. No longer!
With the advent of AI Agents, we can let LLM’s be the experts and request they make the changes we desire. To help an Agent do a good job follow the instructions below.
- Make sure the Agent has a good prompt - We recommend using our specially designed agent to help
- Provide the existing template as context
- Request the changes to the existing template
- Make sure the agent returns full HTML code while maintaining the variables and templating language code needed for Capacity email templates.
If all goes well, you should be able to request things like removing a section, making images smaller, adding color or drop shadows, and anything else you can imagine.
