This guide explains how to set up an auto responder using the Automation Plugin in Discourse. The auto responder can automatically reply to posts or personal messages containing specific keywords.
Required user level: Administrator
An auto responder in Discourse can automatically reply to posts containing certain keywords or phrases. This feature can help moderators and administrators focus on more complex tasks by automating responses to common queries or situations.
Summary
This guide covers:
Creating a new auto responder script
Choosing and configuring a trigger
Setting up word/answer pairs
Enabling the automation
Creating a new script
Navigate to your site’s automation’s page at example.discourse.com/admin/plugins/discourse-automation
The key is evaluated as a regex string. Escape special characters like . with a backslash (e.g., \.). You can test your Regex expressions on regex101.com using the ECMAScript flavor.
Use %%KEY%% in the value field as a placeholder for the detected trigger word.
Enabling the automation
Check the Enabled checkbox at the bottom of the screen
Click Update to save your changes
Automations can be saved without being enabled by leaving the Enabled checkbox unchecked.
Is it possible to limit the auto-response to the initial post for a topic? One might think that Once would do that, but (in obvious retrospect) that’s only correct if the topic is created after the automation.
So… you have a category of old discussions, and when someone replies there you get an auto-response that is not useful, but does contain information that is useful in response to a topic being created… correct?
If that is the case, unfortunately I do not think this automation currently supports that behavior. I ran through the other automations, and I think the only one that might work would be triage with AI, but that seems expensive to get the results you are looking for.
Currently, Use %%KEY%% in the value field as a placeholder for the detected trigger word is the only template variable available for us in the auto responder automation.
There doesn’t seem to be a built-in variable for accessing the username of the person who PM’ed a group in the auto responder automation. This is a limitation in the current implementation, as other Discourse features (like email templates, AI personas, and the “Send PMs” automation script) do have various user-related variables available.
With that in mind, this is similar to a few other requests we’ve had for this type of feature.
If this is a feature you’re interested in, I would encourage you to create a Feature topic, with more information about what type of template variables you would like to see added to this automation. The more people who show interest in a feature, the more likely it is to make it into Discourse. This sounds like a neat idea and we’d love to know more about what you are looking for.
The auto responder trigger detection is designed to respond to specific regex patterns that you define in your key/value pairs. There’s no explicit feature for a “catch-all” that would trigger when no other key pairs match.
However, since the keys are evaluated as regex strings, you can create a very broad regex pattern as your last entry that would match almost any content. Something like .* would work as a catch-all regex, though this would match everything (including content that matches your other patterns).
When multiple keywords are found in a post or topic, the auto responder will respond with ALL matching responses. The responses will be posted in the same order that the key/value pairs were added or are listed in the configuration.
This means if your post contains keywords that match multiple patterns, you’ll receive multiple automated responses in the sequence they appear in your word/answer pairs list.
Oh, that’s not good. This is for our ticketing system and I would hate to spam a customer with 2 or 3 different e-mail responses when they request help.
It would be awesome if there was a setting to: Combine multiple key pair matches into one reply.
Until then I’ll go back to the original use case and put in the .* and use a unified generic response. Except that it would then need to only fire if {user} has not posted in {category} for {x} days.