Setting up automated admin notice alerts

:bookmark: This guide shows you how to set up an automated monitoring system that sends private messages to your admin group when new admin notices are detected on your Discourse site.

:person_raising_hand: Required user level: Administrator

Overview

Admin notices alert administrators to important site issues such as plugin updates, theme compatibility problems, or security concerns. This guide helps you configure an automated system to proactively notify your admin team whenever new admin notices appear on your site, ensuring you never miss critical updates.

The monitoring system consists of two key components:

  • A Data Explorer query that counts new admin notices created in the last 24 hours
  • A Discourse Automation that runs the query periodically and sends a private message to your admin group when notices are found

Prerequisites

Before you begin, ensure the following plugins are enabled on your site:

  • Data Explorer - Available on Business and Enterprise hosted plans, or can be installed on self-hosted instances
  • Discourse Automation - Bundled with Discourse core (no separate installation required)

:discourse: Hosted by Discourse?

The Automations and Data Explorer plugins are available starting from the Business plan and up.

Create the Data Explorer query

The first step is to create a query that identifies new admin notices.

  1. Navigate to /admin/plugins/explorer in your Discourse site
  2. Click Add to create a new query
  3. Name your query “Admin Notices Count - Last 24 Hours”
  4. Add the following SQL query:
SELECT 'There are new admin notices on dashboard.' AS message, id, created_at
FROM admin_notices
WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '24 hours'
ORDER BY created_at DESC

This query counts admin notices created within the last 24 hours.

  1. Click Save to store the query
  2. Test the query by clicking Run to ensure it returns results correctly

Configure the automation

Next, you’ll set up an automation that runs this query periodically and sends notifications.

Create the automation

  1. Navigate to /admin/plugins/automation/
  2. Click Add automation
  3. For Script, select Schedule a PM with Data Explorer results
  4. Enter a name like “Alert on New Admin Notices”
  5. For Trigger, select Recurring

Configure the trigger

In the trigger section:

  1. Set Recurrence to run according to your preferred schedule (for example, “Every 24 hours”)
  2. Enable Start date and choose when you want monitoring to begin

Configure the script

In the Script section, configure the following fields:

Send to User, Group or Email: Enter your admin group name (typically admins)

Query: Select “Admin Notices Count - Last 24 Hours” (the query you created earlier)

Skip if no results: Enable this option to prevent sending PMs when the count is 0

Now click on “Update automation” button.

Enable the automation

After configuring all settings:

  1. Review your configuration
  2. Click Enable automation toggle at the top of the page to activate the automation
  3. Optionally, click Trigger now to test the automation immediately

How it works

Once enabled, the system operates as follows:

  1. Every 24 hours (or your configured interval), the automation triggers automatically
  2. The Data Explorer query runs and counts admin notices created in the last 24 hours
  3. If the count is greater than 0, a PM is sent to the admin group with the notice count
  4. If no new notices are found, no PM is sent (due to the “Skip if no results” setting)

This ensures your admin team receives timely notifications about new admin notices without being overwhelmed by unnecessary messages.

Troubleshooting

Automation not running

  • Verify the automation is enabled - check the toggle at the top of the automation page
  • Check /logs for any error messages related to the automation
  • Ensure the Automation plugin itself is enabled at /admin/plugins

Not receiving PMs

  • Verify the group name is correct in the “Send to” field
  • Check that the admin group has permission to receive PMs
  • Review your personal notification settings to ensure you receive email notifications for PMs

Query returns no results when notices exist

  • Test the query manually in Data Explorer
  • Verify the time interval parameter matches your automation frequency
  • Check that admin notices actually exist by visiting /admin/dashboard/problems

Additional resources