KapsoEx.Platform.Notifications (kapso_ex v0.1.0)

Copy Markdown View Source

Route Kapso notification events to team destinations (shared email addresses or Slack channels).

Summary

Functions

Creates a shared email destination and sends a verification email (valid for 7 days). It receives notifications once confirmed.

Removes a destination, its routes and pending deliveries.

Deletes a route and cancels its pending deliveries.

Lists shared email and Slack channel destinations, including pending ones.

Lists the event types you can route. Use their key in upsert_route/3.

Lists routes (event type to destination), oldest first.

Routes event_key to a destination. Returns the existing route when it already exists.

Types

result()

@type result() :: {:ok, map() | nil} | {:error, KapsoEx.Error.t()}

Functions

create_email_destination(client, address, opts \\ [])

@spec create_email_destination(KapsoEx.Client.t(), String.t(), keyword()) :: result()

Creates a shared email destination and sends a verification email (valid for 7 days). It receives notifications once confirmed.

Options

  • :label - display name of the destination.

delete_destination(client, destination_id)

@spec delete_destination(KapsoEx.Client.t(), String.t()) :: result()

Removes a destination, its routes and pending deliveries.

delete_route(client, route_id)

@spec delete_route(KapsoEx.Client.t(), String.t()) :: result()

Deletes a route and cancels its pending deliveries.

list_destinations(client)

@spec list_destinations(KapsoEx.Client.t()) :: result()

Lists shared email and Slack channel destinations, including pending ones.

list_event_types(client)

@spec list_event_types(KapsoEx.Client.t()) :: result()

Lists the event types you can route. Use their key in upsert_route/3.

list_routes(client)

@spec list_routes(KapsoEx.Client.t()) :: result()

Lists routes (event type to destination), oldest first.

upsert_route(client, destination_id, event_key)

@spec upsert_route(KapsoEx.Client.t(), String.t(), String.t()) :: result()

Routes event_key to a destination. Returns the existing route when it already exists.