BloomERP

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.

SettingTypeDefaultDescription
idstrRequiredStable identifier used by this definition.Minimum length: 1
documentationstr''Markdown and tagged examples included in the generated developer reference.
folder_typestrRequiredID of the inbox folder type the source supplies.
sourceBaseInboxSourceRequiredJob, event, or signal configuration for the source.
originstrRequiredName 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

FieldValue
folder_typein_app_notifications
originInboxFolderRegistry.in_app_notifications

mentions.created

ID mentions.created

FieldValue
folder_typein_app_notifications
originInboxFolderRegistry.in_app_notifications

workflow.result

ID workflow.result

FieldValue
folder_typein_app_notifications
originInboxFolderRegistry.in_app_notifications

system.message

ID system.message

FieldValue
folder_typein_app_notifications
originInboxFolderRegistry.in_app_notifications

form.submission.created

ID form.submission.created

FieldValue
folder_typein_app_notifications
originInboxFolderRegistry.in_app_notifications

workflow.approval_required

ID workflow.approval_required

FieldValue
folder_typein_app_notifications
originInboxFolderRegistry.in_app_notifications

email.sync.dispatch

ID email.sync.dispatch

FieldValue
folder_typeemail
originInboxFolderRegistry.email

email.sync.account

ID email.sync.account

FieldValue
folder_typeemail
originInboxFolderRegistry.email

im.conversation.activity

ID im.conversation.activity

FieldValue
folder_typeinstant_messaging
originInboxFolderRegistry.instant_messaging