DripDrop.Recipients (DripDrop v0.1.0)

Copy Markdown View Source

Normalizes channel recipient identifiers for matching and policy checks.

Phone numbers use ExPhoneNumber/libphonenumber when the input can be parsed for the configured default region, falling back to conservative digit cleanup for incomplete fixture or provider-supplied values. Email addresses are trimmed and downcased for operational suppression matching.

Summary

Functions

Normalizes a recipient value for a DripDrop channel.

Parses and formats a phone number as E.164.

Returns true when an email address passes ExEmail syntax validation.

Functions

normalize(channel, recipient, opts \\ [])

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

Normalizes a recipient value for a DripDrop channel.

normalize_phone(phone, default_region \\ "US")

@spec normalize_phone(binary(), binary()) :: {:ok, binary()} | {:error, term()}

Parses and formats a phone number as E.164.

valid_email?(email)

@spec valid_email?(binary()) :: boolean()

Returns true when an email address passes ExEmail syntax validation.