Built-ins
RegisteredInboxSource
Associate a runtime inbox source with the folder type it supplies.
Register source declarations through InboxSourceRegistry. The registry records their origin and uses the source ID to find the resolver and delivery handler.
| Setting | Type | Default | Description |
|---|---|---|---|
id | str | Required | Stable identifier used by this definition.Minimum length: 1 |
documentation | str | '' | Markdown and tagged examples included in the generated developer reference. |
folder_type | str | Required | ID of the inbox folder type the source supplies. |
source | BaseInboxSource | Required | Job, event, or signal configuration for the source. |
origin | str | Required | Name of the registration that contributed the source. |
Register a project event for system notifications
Reuse the system message resolver and handler. The event publisher supplies recipient IDs, message type, and message data.
python
from bloomerp.communication.builtins.in_app_notifications.inbox_sources import handle_system_message, resolve_system_message_folders
from bloomerp.communication.inbox_sources import InboxEventSource, InboxSourceRegistry
from bloomerp.communication.registry import INBOX_FOLDER_REGISTRY
review_event = InboxEventSource(
id="example.review_requested",
folder_qs_resolver=resolve_system_message_folders,
handler=handle_system_message,
run_async=False,
)
InboxSourceRegistry.register_source(
review_event,
folder_type=INBOX_FOLDER_REGISTRY.IN_APP_NOTIFICATIONS.id,
origin="example.reviews",
)Connect an inbox source to a project signal
Declare the signal and a stable receiver ID. When the app sends the signal, it supplies the same notification arguments as the event source.
python
from django.dispatch import Signal
from bloomerp.communication.builtins.in_app_notifications.inbox_sources import handle_system_message, resolve_system_message_folders
from bloomerp.communication.inbox_sources import InboxSignalSource, InboxSourceRegistry
from bloomerp.communication.registry import INBOX_FOLDER_REGISTRY
review_due = Signal()
review_due_source = InboxSignalSource(
id="example.review_due",
signal=review_due,
dispatch_uid="example.review_due.receiver",
folder_qs_resolver=resolve_system_message_folders,
handler=handle_system_message,
run_async=False,
)
InboxSourceRegistry.register_source(
review_due_source,
folder_type=INBOX_FOLDER_REGISTRY.IN_APP_NOTIFICATIONS.id,
origin="example.reviews",
)document_signing.signature_required
ID document_signing.signature_required
| Field | Value |
|---|---|
folder_type | in_app_notifications |
origin | InboxFolderRegistry.in_app_notifications |
mentions.created
ID mentions.created
| Field | Value |
|---|---|
folder_type | in_app_notifications |
origin | InboxFolderRegistry.in_app_notifications |
workflow.result
ID workflow.result
| Field | Value |
|---|---|
folder_type | in_app_notifications |
origin | InboxFolderRegistry.in_app_notifications |
system.message
ID system.message
| Field | Value |
|---|---|
folder_type | in_app_notifications |
origin | InboxFolderRegistry.in_app_notifications |
form.submission.created
ID form.submission.created
| Field | Value |
|---|---|
folder_type | in_app_notifications |
origin | InboxFolderRegistry.in_app_notifications |
workflow.approval_required
ID workflow.approval_required
| Field | Value |
|---|---|
folder_type | in_app_notifications |
origin | InboxFolderRegistry.in_app_notifications |
email.sync.dispatch
ID email.sync.dispatch
| Field | Value |
|---|---|
folder_type | email |
origin | InboxFolderRegistry.email |
email.sync.account
ID email.sync.account
| Field | Value |
|---|---|
folder_type | email |
origin | InboxFolderRegistry.email |
im.conversation.activity
ID im.conversation.activity
| Field | Value |
|---|---|
folder_type | instant_messaging |
origin | InboxFolderRegistry.instant_messaging |
