Settingsbeginner

Recipe — Auto-tag conversations by message content

Apply a tag automatically when an inbound message contains specific keywords. The classic example: tag anything mentioning 'refund' or 'return' as a Returns case.

4 min read

Recipe — Auto-tag conversations by message content

When an inbound message contains specific keywords, apply a tag automatically. The simplest pattern is a Returns tag for any message mentioning “refund” or “return.”

Auto-tagging is a foundation for downstream rules — once conversations are tagged consistently, you can route, escalate, and report on them.

What this rule does

  • Trigger: A new inbound message arrives.
  • Condition: Message body contains one of a list of keywords.
  • Action: Add the corresponding tag.

Before you start

Build it

Go to Settings → Automation rules, click Add rule, then Build it by hand instead. Or type “Tag conversations that mention a refund or a return with Returns” and click Build it, then check the result against this table.

  • When — A customer sends a message
  • Only if — Match any of these: Content contains refund, Content contains return
  • Then — Add tag → Returns

Set Match to any of these: one condition can check only one substring. The Reads as sentence then joins them with “or”.

Why this does not fire on agent replies

A customer sends a message runs for any message an agent did not send, so agent replies containing “refund” — including the reply where the agent writes “Sure, we’ll process your refund” — never reach these conditions.

Note that “not sent by an agent” is broader than “sent by the customer”: some system-generated messages, such as the marker written when an outbound call starts, also start this trigger. If a rule needs to exclude those, match on message content rather than looking for a direction condition — there isn’t one.

Variants

Multiple tags from multiple keyword groups

One rule per tag is the cleanest pattern, but if you want to keep them together, use branches. In each branch, set Match to any of these:

  • Only if — Content contains refund, Content contains return — Add tag Returns
  • Otherwise, if — Content contains shipping, Content contains delivery — Add tag Shipping
  • Otherwise, if — Content contains password, Content contains login — Add tag Auth

Branches are checked from the top down, and only the first one that matches runs. To add every matching tag (not only the first), build one rule per tag.

Language-aware keywords

Keywords differ across languages. For multi-language teams, you have two options:

  1. One rule per language, gated on the conversation’s detected language.
  2. One rule with all keywords, with Match set to any of these: Content contains refund, Content contains rückgabe, Content contains remboursement … Simpler but less precise.

Negative tags

With Match set to all of these, the conditions Content contains “thank you” and Content does not contain “but” let you tag genuine positive feedback without sweeping in hedged complaints.

Verify it worked

Send a test inbound email that contains the keyword. Within a few seconds, the destination tag should be applied to the conversation. Send a second test reply as the agent with the same keyword — the rule should not re-fire (because of the inbound condition).

Troubleshooting

  • Symptom: Rule fires on every message, even those without the keyword. Fix: Match is set to the wrong all / any, or a condition is missing. Read the Reads as sentence to check.

  • Symptom: Rule re-tags the same conversation repeatedly. Fix: You can ignore it: Add tag does not add a tag that is already there.

  • Symptom: False positives (“preform” matches because of “form”). Fix: Use word-boundary-aware keywords if available, or pick more specific phrases. Atender’s contains is substring-match; it doesn’t recognize word boundaries.

See also

Tags

Recipe