Adding more information to the subject line of watcher relayed mail
Introduction
Often, watchers who receive copies of new helpdesk messages want to filter those messages in their email client. In earlier versions of Cerb5, the subject line for these messages was hard-coded to include an "incoming" or "outgoing" tag, and a ticket mask. As of 5.4.3, the subject line for relayed mail defaults to the ticket subject, but you can also customize it through the interface using snippets.
In this cookbook recipe, we're going to add back tags and ticket masks to the subject lines of watcher email. With what you'll learn, you'll also be able to include any other information you want in either the subject line or message content. For example, you can append the ticket status to the subject, or you can even include a due date or organization name.

Implementation
To start, navigate to your Virtual Attendant by clicking on your name in the top right and clicking on the 'virtual attendant' link.
If you haven't created Attendant behavior for relaying messages on watched tickets, do the following (if you have, skip ahead):
- Under 'Create New Behavior', choose 'New Message on a Watched Conversation'.
- Click on the new behavior and select 'Edit Behavior' from the menu. Enter the title 'Relay messages to my email account'. Click the 'Save Changes' button.
- Now we want to filter out any messages sent by yourself. Click on the new behavior again, and select 'Add Decision' from the menu. Add the title 'Sent by me' and hit the 'Save Changes' button.
- Click on 'Sent by Me' and enter the title 'No'. Click the 'Add Condition' button and select 'Message sender address'. Change the dropdown from 'is' to 'is not' and enter your worker email address. Click the 'Save Changes' button.
- Click on 'No' and select 'Add Actions' from the menu. Set the title to 'Relay email'. Under 'Add Action', select 'Relay to external email'. Select your desired email address from the list. If you haven't already, you can add additional email addresses to your account from your worker preferences page (click your name in the top right and then 'my settings').
- At this point you should be seeing the same screen whether you already had email relay behavior or you just set it up. Now we want to customize the message being sent to us.
Set the subject to the following:
[{%if is_outgoing %}outgoing{%else%}incoming{%endif%} #{{ticket_mask}}]: {{ticket_subject}}
Click the 'Test' button to make sure you entered it correctly.
Here's an explanation of exactly what is going on:
The conditional statement {%if is_outgoing %} is checking whether or not the current message is outgoing (i.e. being sent by a worker). If so, the word "outgoing" is added to the subject. If not, the {%else%} section is providing "incoming" as the alternate text to display.
The {{ticket_mask}} placeholder will display the ticket's mask, such as ABC-12345-678.
And, finally, the {{ticket_subject}} placeholder will display the ticket's subject.
This should produce a ticket subject for relayed email that looks like:
[incoming #ABC-12345-678]: I'd like to discuss pricing information.
More Things to Try
You could also add the sender's organization to the subject line, if you know it, by appending the following:
{%if sender_org_name %} ({{sender_org_name}}){%endif%}
Perhaps you'd also like to append the ticket's current status: open, waiting, closed, or deleted. Append the following:
({{ticket_status}})
In the above examples, the important information is the {{placeholder}}, with double curly braces on either side. I've also wrapped them in (parenthesis) for clarity, so you can tell them apart from the ticket subject. You can change this to whatever format you want, just make sure to click the 'Test' button before you save your changes.