AshDispatch.Transports.InApp (AshDispatch v0.5.0)
View SourceIn-app notification transport.
Creates in-app notifications immediately (synchronous).
Behavior
- Checks user preferences (if event is user_configurable)
- Resolves recipients from context
- Creates Notification records
- Updates receipt status to
:sent
Status Flow
pending → sent (success)
↘ failed (error)
↘ skipped (user opted out)Example
receipt = %{
content: %{
title: "Order Created",
message: "Your order #1234 is being processed",
action_url: "/orders/1234",
notification_type: :success
}
}
InApp.deliver(receipt, context, channel, event_config)
# -> Creates Notification records
# -> Returns {:ok, updated_receipt}
Summary
Functions
Delivers an in-app notification.
Retry a failed in-app delivery directly from a stored receipt.
Functions
Delivers an in-app notification.
Parameters
receipt- DeliveryReceipt mapcontext- Event contextchannel- Channel configurationevent_config- Event configuration
Returns
{:ok, updated_receipt}on success{:error, reason}on failure
Retry a failed in-app delivery directly from a stored receipt.
In-app delivery is synchronous (DB write + PubSub broadcast), so we re-attempt the Notification.create directly rather than going through Oban.
Uses the receipt's stored content and idempotency_key to prevent duplicates.
Returns :ok on success or {:error, reason} on failure.