Logotipo Hedhog

Get Hedhog updates in your inbox

New releases, fresh recipes, and breaking changes — no spam.

Campaign Submodule

messages

Read access to individual per-recipient delivery records (campaign_message) for a campaign.

Source path: libraries/campaign/src/services/campaign-message.service.ts

Module file: campaign.module.ts

Introduction

The Messages submodule is the thinnest in the package: it exposes read access to `campaign_message`, the row created once per recipient when a campaign starts sending. Each message tracks its own delivery lifecycle independently of the parent campaign — `pending` → `queued` → `sending` → `sent` | `failed` | `skipped` | `unsubscribed` — along with `attempts`, `last_error`, and timestamps (`queued_at`, `sent_at`, `failed_at`, `skipped_at`). This per-message granularity is what lets a paused-then-resumed campaign know exactly which recipients still need a send and which are already done, and it is what CampaignDashboardService groups by status to build delivery breakdowns.

The campaign-scoped listing endpoint actually lives on the Campaigns controller surface (`GET /campaign/:id/messages`) and is implemented by `CampaignMessageService.listByCampaign`, which — beyond simple pagination/search/status filtering — joins in per-message open/click counts from `campaign_tracking` and unsubscribe/complaint counts from `campaign_event`, so a single list call shows engagement signals alongside delivery status without separate round-trips.

This submodule's own dedicated endpoint, `GET /campaign/messages/:id`, returns the full record for one message by its own ID — including its bounce details and error string — independent of which campaign it belongs to, which is convenient for support workflows like the dashboard's "recent errors" list.

HTTP Endpoints

1 endpoint

Get the full delivery record for a single message, including status, timestamps, attempts, and last_error.

Params
id (int)