DripDrop.Suppressions (DripDrop v0.1.0)

Copy Markdown View Source

Normalize, create, and query channel suppressions.

Summary

Functions

Normalizes a recipient for suppression matching.

Upserts a normalized suppression row for a channel recipient.

Returns true when a normalized recipient is suppressed for the tenant scope.

Functions

normalize(channel, recipient)

@spec normalize(atom() | binary(), binary()) :: binary()

Normalizes a recipient for suppression matching.

suppress(attrs)

@spec suppress(map()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Upserts a normalized suppression row for a channel recipient.

suppressed?(channel, recipient, tenant_key \\ nil)

@spec suppressed?(atom() | binary(), binary(), binary() | nil) :: boolean()

Returns true when a normalized recipient is suppressed for the tenant scope.