Creating an auto responder automation

:bookmark: 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.

:person_raising_hand: 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

  1. Navigate to your site’s automation’s page at example.discourse.com/admin/plugins/discourse-automation
  2. Click + Create to create a new script
  3. Select the Auto Responder option
  4. Click + Create again to proceed

Choosing a trigger

Select one of two trigger options:

  1. Post Created / Edited
  2. Personal Message Created

Post Created / Edited trigger options

  • Action Type: Limit to posts being created or edited
  • Category: Limit to specific categories
  • Group: Limit to private messages in a specific group’s inbox
  • Ignore Automated: Skip if the sender has a noreply email or is from an automated source
  • Ignore Group Members: Skip if the sender is a member of the specified group
  • Valid Trust Levels: Limit to posts from users with specific trust levels
  • First Post Only: Limit to a user’s first post
  • First Topic Only: Limit to a user’s first topic

Personal Message Created trigger options

  • Users: Limit to PMs sent to specific users
  • Group: Limit to PMs sent to a specific group
  • Ignore Staff: Skip if the sender is a staff user
  • Ignore Automated: Skip if the sender has a noreply email or is from an automated source
  • Ignore Group Members: Skip if the sender is a member of the specified group
  • Valid Trust Level: Limit to PMs from users with specific trust levels

Configuring script options

After setting up the trigger, configure the following options:

  1. Word / answer pairs: Define keywords and corresponding responses
  2. Answering user: Select the user account for automated replies
  3. Once checkbox: Limit the automation to trigger only once per topic

Setting up word/answer pairs

  1. Click the Configure button next to list of word / answer pairs
  2. Enter key/value pairs:
    • Key: The trigger word or phrase (case-insensitive)
    • Value: The automated response text

:information_source: 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.

:mega: Use %%KEY%% in the value field as a placeholder for the detected trigger word.

Enabling the automation

  1. Check the Enabled checkbox at the bottom of the screen
  2. Click Update to save your changes

:warning: Automations can be saved without being enabled by leaving the Enabled checkbox unchecked.

Last edited by @hugh 2024-07-26T02:28:53Z

Check documentPerform check on document:
9 Likes

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.

1 Like

Alternately (or additionally?), could the auto-post be back-dated to come immediately after the topic OP (and then merged in that order)?

1 Like

My use case: replying to topics in a certain category with a new poll for that topic.

1 Like

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? :smiley:

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. :sweat_smile:

3 Likes

Yes, correct. How hard would it be to make a new option for this one where it would only respond to new topics?

1 Like

4 posts were split to a new topic: Can the auto-responder fire on @mentions?

A post was split to a new topic: Post Created / Edited Trigger for Send PMs Automation