Skip to content

Rules

A rule is the heart of the plugin: it says when this happens, send this payload to this destination. You build rules in Webhook Notifier → Rules, and most of the time you'll never need to touch code to do it.

Anatomy of a rule

Every rule has four parts:

PartWhat it decides
SourceThe trigger - what has to happen for the rule to run. See Sources.
ConditionsOptional filters that narrow the trigger down to the cases you care about.
ConnectionThe destination the notification is sent to. See Connections.
PayloadWhat's actually sent - a Teams Adaptive Card, or a raw body of your own. See Payloads and cards.

A rule also has an Enabled switch. A disabled rule is left in place but never fires, which is useful for pausing a noisy notification without losing its setup.

Creating a rule

  1. Go to Webhook Notifier → Rules → New.
  2. Give the rule a Name.
  3. Choose a Source. The editor shows a short description of when that source fires and lists the variables it makes available.
  4. Add any Conditions (see below). Leave them empty to fire on every event from that source.
  5. Pick the Connection to send to, or leave it on the default.
  6. Build the Payload - pick a card mode and fill it in. See Payloads and cards.
  7. Save. The rule is live as soon as it's enabled.

Conditions

Conditions filter a source's events down to the ones you want. Each condition tests one field from the source's context with an operator and a value:

  • section equals news
  • isNew equals true
  • total is greater than 50
  • event equals registered

The Field and Operator dropdowns populate from the source you've chosen, so you only ever see fields that source actually provides, and they update live if you change the source.

Conditions are combined with AND

Where a rule has more than one condition, every one of them has to pass. There's no OR: to fire on either of two cases, build two rules pointing at the same connection.

Operators

  • equals / does not equal - string or boolean comparison.
  • is greater than / greater than or equal to / less than / less than or equal to - numeric comparison, for fields like the queue total.

If you need logic that conditions can't express, you can often do it inside the payload template instead - see Payloads and cards - or reach for a Custom event rule and shape the body with full Twig.

The rules list

The Rules screen lists every rule with its source, connection and enabled state. Each rule also shows a small 14-day activity sparkline - a mini bar chart of recent sends (in green) and failures (in red), with a sent/failed count - so you can see at a glance which rules are busy and which are erroring, without opening the log.

A worked example

Say you want a Teams message in your #content channel whenever a News entry is first published:

  1. Source: Entry saved.
  2. Conditions: section equals news, and isNew equals true.
  3. Connection: your Teams #content connection.
  4. Payload: a Structured Teams card with a title of New article: {title}, a body, and a "View entry" button linking to {url}.

Now every freshly published News entry posts a tidy card to Teams, and nothing else does.

Digital help you can trust.