> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Providers and webhooks

> Resend for email, OneSignal for push, SMS and Live Activities, Horizon for in-app: how each is called, how push finds the device, which webhooks report delivery and what they change.

## What it is for

A provider is the external service that actually delivers the message. This page explains which provider each
channel uses, how Horizon targets the recipient and how the provider's reports come back. It replaces the old
"Channels & Targeting" page, which now redirects here.

## Provider per channel

| Channel | Provider | How Horizon delivers | Who it reaches |
| - | - | - | - |
| Email | Resend | One API call per send, tagged with the send id | The recipient's address |
| Push | OneSignal | One API call per send to the app's users | Every device where the user is signed in to MaihueGO or Maihue Lunch |
| In-app | Horizon (no provider) | Writes the item in the inbox | The MaihueGO inbox or the Horizon Enterprise bell |
| SMS (coming soon) | OneSignal | One API call to the phone number | The phone, in E.164 format |
| Live Activities (coming soon) | OneSignal | Start, update or end of a Live Activity | The iPhone lock screen |
| WhatsApp (reserved) | None chosen | The channel is always skipped | — |

OneSignal has two apps: the default one (MaihueGO) and Maihue Lunch. Each send records which one it used.

## How push finds the device

Horizon keeps no device tokens. The app signs in to OneSignal with the Horizon user id, and push targets that id:

| Case | Target |
| - | - |
| Normal push | The user id as OneSignal `external_id`: every device of that user receives it |
| Device commands and test pushes of one installation | That installation's OneSignal subscription only |
| The user never opened the app, or refused notifications | OneSignal answers that nobody is subscribed and the send becomes **Skipped** |

A visible push carries its action in the data (`path`, `url`, or `deep_link` with `url`) and its buttons as
OneSignal action buttons; a silent push carries neither text nor buttons. See [Push channel](https://docs.bbrands.io/enterprise/notifications/channels/push.md).

## Webhooks: how delivery comes back

| Provider | Address | How Horizon trusts it | What it reports |
| - | - | - | - |
| Resend | `POST /api/v3/integration/resend/webhook` | Svix signature (HMAC-SHA256 over id, timestamp and body, 5 minutes of tolerance) | `email.sent`, `email.delivered`, `email.delivery_delayed`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained`, `email.failed` |
| OneSignal | `POST /api/v3/integration/onesignal/webhook` | A secret per app in the `Authorization` header, compared in constant time; anything else is refused | Received, clicked, failed or undelivered, for push, SMS and Live Activities |

Both webhooks answer fast: they record the event once (repeated deliveries are ignored) and put it on their own
queue (`resend-webhook`, `onesignal-webhook`). A consumer then matches it to the send by the provider's message id
and writes it in the channel's event table. That is what the send's timeline and [**Delivery events**](https://docs.bbrands.io/enterprise/notifications/operation/delivery-events.md) show.

## What a report changes

| Report | Send status | Also |
| - | - | - |
| Email sent / delivered | **Sent** / **Delivered** | |
| Email delivery delayed | No change | Shown in the timeline |
| Email opened / clicked | **Opened** / **Clicked** | |
| Email bounced, permanent | **Bounced** | The address goes to [**Suppressions**](https://docs.bbrands.io/enterprise/notifications/audience/suppressions.md) (hard bounce) |
| Email marked as spam | **Marked as spam** | The address goes to **Suppressions** (complaint) |
| Email failed | **Failed** | The fallback channel runs |
| Push or SMS received | **Delivered** | |
| Push tapped | **Clicked** | |
| Push or SMS failed | **Failed** | The fallback channel runs; a permanent SMS failure suppresses the number |
| In-app seen / read | **Opened** / **Clicked** | Written by Horizon when the customer opens the inbox |

A failed, bounced or expired send runs its fallback at most once per occurrence, recipient and channel. Security
sends are never blocked by a suppression.

## Technical detail

| Aspect | Detail |
| - | - |
| Email adapter | `backend/horizon-api/lib/notification/channel/email/resend.adapter.ts` (idempotency key = send id) |
| OneSignal client and adapters | `backend/horizon-api/lib/integration/onesignal/onesignal.client.ts`; `lib/notification/channel/onesignal/{push,sms,live-activity}.adapter.ts` |
| In-app adapter | `backend/horizon-api/lib/notification/channel/in-app/in-app.adapter.ts` |
| Webhook routes | `backend/horizon-api/app/api/v3/integration/resend/webhook/` and `…/onesignal/webhook/` |
| Ingest | `backend/horizon-api/lib/notification/events/email-event.ingest.ts`, `onesignal-event.ingest.ts` and the per-channel ingests |
| Automatic suppressions | `backend/horizon-api/lib/notification/suppression/suppression.service.ts` |
| Delivery fallback | `backend/horizon-api/lib/notification/events/platform-event.hooks.ts`, `delivery-fallback.port.ts` |
| Event tables | `notification_email_event`, `notification_push_event`, `notification_sms_event`, `notification_live_activity_event`, `notification_in_app_event`, `notification_whatsapp_event` |

## Related and history

* [Channels overview](https://docs.bbrands.io/enterprise/notifications/channels/overview.md)
* [Delivery pipeline](https://docs.bbrands.io/enterprise/notifications/reference/delivery-pipeline.md)
* [States and reasons](https://docs.bbrands.io/enterprise/notifications/reference/states-and-reasons.md)

| Date | Change |
| - | - |
| 2026-11-11 | First version, rewritten from the old "Channels & Targeting" page, which now redirects here |
| 2026-11-13 | What a push carries: its action in the data and its buttons as OneSignal action buttons (issue #2212) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.