Logotipo Hedhog

Get Hedhog updates in your inbox

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

sac Submodule

channels

Defines where tickets come from and how replies leave: kind, public submission, CAPTCHA, notification recipients and reply domain.

Source path: libraries/sac/src/channel

Module file: channel.module.ts

Introduction

A channel is what makes a second source of tickets possible without a schema change. `kind` (`web_form`, `email`, `whatsapp`, `phone`, `chat`, `api`, `admin`) is not decorative: it decides the transport of an agent reply. A ticket on a channel of kind `whatsapp` is answered over WhatsApp; every other kind goes out by e-mail.

Each channel can override the global configuration where it matters: `notify_emails` for the internal alert, `received_mail_slug` for a specialised acknowledgement template, and `reply_domain` when different brands need different reply addresses.

`is_public` controls whether the channel accepts an unauthenticated `POST /sac/public/tickets`. An internal submission from another library resolves the channel by "active" rather than "public", so a channel can accept tickets from code while refusing anonymous posts.

HTTP Endpoints

4 endpoints

Paginated channel list with ticket counts.

Query
page, pageSize, search

Create a channel.

Body

FieldTypeRequiredNotes
slugstring (kebab-case)yes
localeRecord<locale, { name }>yes
kindweb_form | email | whatsapp | phone | chat | api | adminno
is_publicbooleannoWhether the channel accepts unauthenticated public submissions
reply_domainstringnoOverrides the global sac.mail.reply-domain for this channel

Update a channel.

Params
id (int)

Delete a channel. Refused with a readable error when tickets already reference it — deactivate instead.

Params
id (int)