Bỏ qua, đến nội dung

@digiforce-nc/plugin-mailbox

Plugin hộp thư email — nhận/gửi email trực tiếp trong Digiforce, quản lý conversation theo thread, đính kèm file, và liên kết email với record.

Plugin này làm gì?

Thay vì chuyển qua ứng dụng email riêng, plugin cho phép gửi/nhận email ngay trong Digiforce và tự động tổ chức thành conversation. Email từ khách hàng tự gắn vào record tương ứng, reply trực tiếp từ giao diện Digiforce, và mọi attachment được quản lý tập trung.

Ba nhiệm vụ chính

#Nhiệm vụChi tiết
1Nhận emailĐồng bộ email từ IMAP, parse body + attachments, tổ chức thành thread
2Gửi emailSoạn và gửi qua SMTP, hỗ trợ reply/forward, đính kèm file
3Record linkingTự động liên kết email với record (ticket, khách hàng, đơn hàng)

Kiến trúc

Luồng nhận email (IMAP sync)

API endpoints

EndpointMô tả
mailbox:listDanh sách email (inbox, sent, draft)
mailbox:getChi tiết email theo ID
mailbox:sendGửi email mới
mailbox:replyReply email trong thread
mailbox:forwardForward email
mailbox:syncTrigger đồng bộ IMAP thủ công
mailbox:threadsDanh sách conversation threads
mailbox:attachmentsDanh sách attachments của email

Database

BảngChứa gì
mailboxAccountsTài khoản email (IMAP/SMTP credentials)
mailboxMessagesEmail messages (from, to, subject, body, status)
mailboxThreadsConversation threads (nhóm email cùng chủ đề)
mailboxAttachmentsMetadata file đính kèm (filename, size, storageKey)

Cấu hình

Tham sốMô tả
imapHostIMAP server hostname
imapPortIMAP port (mặc định: 993 SSL)
smtpHostSMTP server hostname
smtpPortSMTP port (mặc định: 587 STARTTLS)
emailĐịa chỉ email
passwordMật khẩu hoặc App Password
syncIntervalTần suất đồng bộ IMAP (phút)

Thành phần client

Thành phầnMô tả
MailboxInboxGiao diện hộp thư đến — danh sách email với preview
ComposeEmailForm soạn email (rich text editor, attachments)
EmailThreadHiển thị chuỗi email conversation
MailboxConfigCấu hình tài khoản email (Settings → Mailbox)
RecordEmailTabTab email trong record detail — hiển thị email liên quan

Dependencies

PackageVai trò
@digiforce-nc/serverServer framework (peer)
@digiforce-nc/databaseDatabase ORM (peer)
@digiforce-nc/clientClient UI framework (peer)
nodemailerSMTP client — gửi email
imapIMAP client — nhận email

Mục lục chi tiết