Bonfire.Notify (Bonfire v1.0.1-social-alpha.28)
View SourcePublic API for sending notifications.
This module provides a simple entrypoint that delegates to the underlying notification system (WebPush for push notifications, LivePush for in-app notifications).
Summary
Functions
Formats a notification message for web push.
Sends a notification about an object to a user or list of users.
Sends push notifications to specific user IDs.
Functions
Formats a notification message for web push.
This creates a JSON payload compatible with the Web Push API and browser notification display.
Sends a notification about an object to a user or list of users.
This is a convenience function that:
- Records the notification in the database
- Sends web push notifications to subscribed devices
- Formats the notification message appropriately
Examples
# Notify a single user
notify(post, user)
# Notify multiple users
notify(reply, [user1, user2, user3])
Sends push notifications to specific user IDs.
This is a convenience wrapper around WebPush.send_web_push/3.