Ticket Mention trigger

This solution may be overkill for environments with a large number of agents, but for smaller teams it provides a practical way to notify an agent when they are mentioned, instead of relying on the generic “Ticket was updated” notification.

Since Zammad currently does not support dynamic mention-based email addressing, this workaround has to be configured per agent. When an internal note is written using @@Name, Zammad converts the mention into a link in the article body that contains the HTML attribute data-mention-user-id="X", where X is the internal user ID.

By using this attribute as a trigger condition (article body contains data-mention-user-id="X"), it is possible to send a dedicated email notification only to the mentioned agent, with the trigger’s email recipient explicitly set to the same user ID(to get the atribute tag, mention a user in the note and inspect it using developer tools in the browser).
The trigger also temporarily subscribes the mentioned user to the ticket and automatically unsubscribes them after execution, even if an explicit unsubscribe action is not configured.

I’m sharing this in case it’s useful or interesting to others who are looking for a similar workaround, or you see this as something for any future development.

If you use n8n you can solve this with only one trigger/webhook for all agents and use it in bigger environments. I have it running for our instance and have also added a custom user object to let him decide if he wants a mail notification or not. (Though agents can’t change that in Zammad themselves)

The trigger looks for a new message with a mention and n8n then looks up the user to determine if he wants to have an email and to get the mail address. After that it just sends the mail.

I’ve also added a feature that the user can decide if he wants to be subscribed after a mention or not (I’m using a custom user object to track that as well and just unsubscribe the mentioned user from the ticket)