Rule notifications in Slack, email and webhooks
Send matched rule events to a Slack channel, an email list or a signed HTTPS webhook, and check every delivery in the activity log.
Last updated
On this page
A rule can tell you when it matches something. You set this up in each rule's editor. Notifications only report what happened. They never change ads. Notifications don't work with sample data.
Slack
Connect Slack once per workspace. Go to Connect › Connections (/connect), open the Slack card and click Connect Slack. Only owners and admins can do this. When it's connected, you can pick a channel and click Test notification to check that messages arrive.
Turn it on for a rule:
- Open the rule and find Slack notifications.
- Tick Send matched rule events to Slack.
- Choose a Slack channel. The list only shows public channels the AdMassy app has joined.
- Save the rule. The Slack setting is saved together with the rule.
Each new match sends the rule name, object name, account and object IDs, and the time. Spend and other money figures are not included.
If you reconnect Slack, older rules show Saved destination belongs to an older connection. Pick the channel again, or click Use current connection.
Tick Email matched events under Webhook and email. Then enter up to 10 recipients, separated by commas, and click Save email alert. Each email has the subject Rule matched: <rule name> and lists the account, object, metrics, event ID and time.
Email has to be set up on the server. If it isn't, the checkbox is disabled and you see:
Email notifications are disabled: set RESEND_API_KEY and NOTIFICATION_EMAIL_FROM on the server to enable the email channel.
Webhook
- Tick Send a signed HTTPS webhook.
- Enter a Webhook URL. It must be a public HTTPS address on port 443. Local and private addresses are rejected.
- Choose a Method: POST, PUT or PATCH.
- Optional: add Headers, one
Name: valueper line. You can useAuthorization,Acceptor customX-headers, up to 10. - Edit the JSON body template if you need to. The default sends the event type, event and delivery IDs, time, account, rule, object and metrics. The field label lists the placeholders you can use.
- Click Save webhook. The first time you save, AdMassy shows the signing secret once, so copy and store it right away.
Every request includes these headers:
| Header | Value |
|---|---|
X-AdMassy-Signature | t=<unix time>,v1=<HMAC-SHA256 of "t.body"> |
X-AdMassy-Event | rule.matched, or test for test sends |
X-AdMassy-Delivery | A unique delivery ID |
User-Agent | AdMassy-Webhooks/1 |
Reject any request whose timestamp is more than a few minutes old.
Retries: AdMassy tries again after timeouts (10 seconds), network errors, HTTP 5xx and 429 responses. The wait starts at 30 seconds and doubles up to one hour, or follows Retry-After when that is longer. After 5 attempts it gives up. Redirects are never followed, and other 4xx responses fail right away.
Note: Webhook and email settings save as soon as you click their save buttons, not when you save the rule. They appear only after a rule has been saved once. Use Send test to try each one.
When notifications don't send
The server operator controls whether messages can go out. If Slack sending is off, you see Notification sending is disabled for this deployment. A test webhook or email instead says sending is disabled on this server (AUTOMATION_OUTBOUND_SENDING_ENABLED). If Slack isn't set up on the server, the Slack card says Slack OAuth is not configured for this deployment.
Delivery history
- The rule editor lists the latest webhook and email deliveries with their state and HTTP status, plus Retry and Cancel where possible.
- Automate › Rule activity has a Notifications section for Slack. Expand a row to see each attempt and its error, then use Retry notification or Cancel queued. Show rule activity filters the log to that rule.
A Slack message marked Acceptance unknown is never resent automatically, so you won't get duplicates.
Related
Was this article helpful?