Bỏ qua, đến nội dung

@digiforce-nc/plugin-notifications

Plugin thông báo cơ bản (deprecated) — hệ thống notification legacy. Khuyến nghị sử dụng plugin-notification-manager thay thế.

Plugin này làm gì?

Lưu ý: Plugin này đã deprecated. Các dự án mới nên dùng @digiforce-nc/plugin-notification-manager — hệ thống thông báo thế hệ mới với multi-channel, template engine, và kiến trúc mở rộng tốt hơn.

plugin-notifications là hệ thống thông báo đời đầu của Digiforce. Nó cung cấp notification center cơ bản: gửi thông báo in-app, hiển thị bell icon với badge count, đánh dấu đã đọc/chưa đọc. Hệ thống này đã phục vụ tốt nhưng thiếu khả năng mở rộng multi-channel và template linh hoạt.

So sánh với plugin-notification-manager

Tính năngplugin-notifications (legacy)plugin-notification-manager (mới)
In-app notification
Multi-channel (email, push, SMS)Không
Template engineCơ bản (lodash.template)Nâng cao
Subscription preferencesCơ bảnNâng cao
Plugin channel mở rộngKhông
Batch / digestKhông

Kiến trúc

Luồng gửi thông báo

Luồng đọc thông báo

API endpoints

EndpointMô tả
notifications:listDanh sách thông báo (phân trang, lọc read/unread)
notifications:getChi tiết thông báo theo ID
notifications:readĐánh dấu 1 thông báo đã đọc
notifications:readAllĐánh dấu tất cả đã đọc
notifications:destroyXóa thông báo
notifications:countĐếm số thông báo chưa đọc (cho badge)
notifications:sendGửi thông báo (internal API cho plugin khác gọi)

Database

BảngMô tảVí dụ
notificationsThông báo (name, subject, body, receiver_options, service){ name: 'n_xxx', subject: 'Task mới', body: '<p>Nội dung</p>' }
notification_servicesCấu hình dịch vụ gửi — SMTP transport (type, title, options){ type: 'email', title: 'SMTP chính', options: { host, port, auth } }
notification_logsNhật ký gửi thông báo (receiver, state, response){ receiver: 'user@example.com', state: 'success' }

Thành phần client

Thành phầnMô tả
PluginNotificationClientPlugin client — hiện tại chỉ đăng ký plugin, chưa có UI riêng

Dependencies

PackageVai trò
nodemailerThư viện gửi email qua SMTP
@digiforce-nc/serverServer framework (peer)
@digiforce-nc/databaseDatabase ORM (peer)
@digiforce-nc/clientClient UI framework (peer)

Mục lục chi tiết