Bonfire.Notify.UserSubscription (Bonfire v1.0.1-social-alpha.28)

View Source

The subscription schema for web push notifications.

Summary

Functions

Creates a changeset for a subscription.

Marks a subscription as failed with an error.

Marks a subscription as expired/inactive.

Marks a subscription as successful.

Parses browser subscription data into the format expected by our schema. Returns an error tuple if the data structure is invalid.

Converts a UserSubscription record to ExNudge.Subscription format.

Updates the last_used_at timestamp for a subscription.

Functions

changeset(struct, attrs \\ %{})

Creates a changeset for a subscription.

mark_error(subscription, reason)

Marks a subscription as failed with an error.

mark_expired(subscription)

Marks a subscription as expired/inactive.

mark_success(subscription)

Marks a subscription as successful.

parse_subscription_data(invalid_data)

Parses browser subscription data into the format expected by our schema. Returns an error tuple if the data structure is invalid.

to_ex_nudge_subscription(subscription)

Converts a UserSubscription record to ExNudge.Subscription format.

touch(subscription)

Updates the last_used_at timestamp for a subscription.