Development Guide
Notifications Service
Notification Content
A notification consist of ...
- type (e.g. chat_invitation)
- title (an ILIAS language variable with placeholders or a plain text, if the language variable could not be resolved)
- short description (an ILIAS language variable with placeholders or a plain text, if the language variable could not be resolved)
- long description (an ILIAS language variable with placeholders or a plain text, if the language variable could not be resolved)
- icon (optional)
- link (optional)
Language Variables for Descriptions
Below you can see how you can use placeholders in your language variables.
- chatroom#:#chat_invitation#:#Invitation from [INVITER_NAME] to Chatroom [ROOM_NAME]
- chatroom#:#chat_invitation_long#:#[SALUTATION]\n\nYou have been invited to a chatroom:\nChatroom Title: [ROOM_NAME]\nInvited by: [INVITER_NAME]\nURL: [LINK]\n\nIf you want to join the chatroom please follow the given URL.
- chatroom#:#chat_invitation_short#:#Please click the title link to enter the chatroom.
Code Examples
Example with Language Variables/Placeholders
1 | $recipient_id = 6; |
Custom Example
1 | $recipient_id = 6; |
General
Delivery Methods:
notifyByUsers
notifyByListeners
(The subscription process is no implemented, yet. The INSERT INTO listener_table .... is missing.)notifyByRoles
The notification system is able to deliver the configured notification directly.
Furthermore you can send them asynchronously (recommended if a notification should be delivered to many recipients). In this case, we have to implement a new cron job task for the ILIAS core (also available in a certain Subversion branch).
Delivered Notifications
Mail System (internal message, external email, or both - depending on the recipients' settings)