mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 21:04:59 +00:00
feat(notification): add email notification infrastructure, smtp configuration, and periodic background delivery job (#431)
* feat(notification): add email notification support and dedicated workflow * feat(webui): add team email notification settings and test email dialog * refactor(webui): remove redundant card header from email notification settings * fix(notification): prevent sending notification emails to AI agents * feat(notification): display project, avatar, upload time and resolve mention names in notification emails * refactor(notification): remove uploadDebounceSeconds and naive workflow sleep * refactor(notification): remove temporal notification workflow and keep email infrastructure * fix(team): prevent leaking email notification settings and credentials in team settings * feat(notification): add periodic background job for batched email notification delivery * fix(notification): embed avatars and thumbnails as inline cid attachments
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "NotificationEmailStatus" AS ENUM ('pending', 'processing', 'processed', 'failed');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "notifications" ADD COLUMN "email_status" "NotificationEmailStatus" NOT NULL DEFAULT 'pending';
|
||||
|
||||
-- Update legacy rows to processed
|
||||
UPDATE "notifications" SET "email_status" = 'processed';
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "notifications_email_status_created_at_idx" ON "notifications"("email_status", "created_at");
|
||||
@@ -76,6 +76,13 @@ enum NotificationType {
|
||||
kanban_task_comment_created
|
||||
}
|
||||
|
||||
enum NotificationEmailStatus {
|
||||
pending
|
||||
processing
|
||||
processed
|
||||
failed
|
||||
}
|
||||
|
||||
enum ProjectMemberRole {
|
||||
owner
|
||||
editor
|
||||
@@ -776,9 +783,12 @@ model Notification {
|
||||
userId String? @map("user_id")
|
||||
user User? @relation("UserToNotification", fields: [userId], references: [id])
|
||||
|
||||
emailStatus NotificationEmailStatus @default(pending) @map("email_status")
|
||||
|
||||
readByMembers TeamMember? @relation("TeamMemberToLastReadNotification")
|
||||
|
||||
@@index([kanbanTaskId])
|
||||
@@index([emailStatus, createdAt])
|
||||
@@map("notifications")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user