mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 04:44:28 +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:
@@ -99,3 +99,51 @@ export const notificationSettingsSchema = z.object({
|
||||
})
|
||||
|
||||
export type NotificationSettings = z.infer<typeof notificationSettingsSchema>
|
||||
|
||||
export const emailNotificationSettingsSchema = z.object({
|
||||
enabled: z.boolean(),
|
||||
host: z.string().default(''),
|
||||
port: z.number().int().min(1).max(65535).default(587),
|
||||
username: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
smtps: z.boolean().default(false),
|
||||
ignoreCert: z.boolean().default(false),
|
||||
from: z.string().default(''),
|
||||
replyTo: z.string().optional(),
|
||||
})
|
||||
|
||||
export type EmailNotificationSettings = z.infer<typeof emailNotificationSettingsSchema>
|
||||
|
||||
export const updateEmailNotificationSettingsSchema = z.object({
|
||||
enabled: z.boolean(),
|
||||
host: z.string().default(''),
|
||||
port: z.number().int().min(1).max(65535).default(587),
|
||||
username: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
smtps: z.boolean().default(false),
|
||||
ignoreCert: z.boolean().default(false),
|
||||
from: z.string().default(''),
|
||||
replyTo: z.string().optional(),
|
||||
})
|
||||
|
||||
export type UpdateEmailNotificationSettings = z.input<typeof updateEmailNotificationSettingsSchema>
|
||||
|
||||
export const testEmailRequestSchema = z.object({
|
||||
host: z.string().optional(),
|
||||
port: z.number().int().min(1).max(65535).optional(),
|
||||
username: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
smtps: z.boolean().optional(),
|
||||
ignoreCert: z.boolean().optional(),
|
||||
from: z.string().optional(),
|
||||
replyTo: z.string().optional(),
|
||||
})
|
||||
|
||||
export type TestEmailRequest = z.infer<typeof testEmailRequestSchema>
|
||||
|
||||
export const testEmailResponseSchema = z.object({
|
||||
success: z.boolean(),
|
||||
messageId: z.string(),
|
||||
})
|
||||
|
||||
export type TestEmailResponse = z.infer<typeof testEmailResponseSchema>
|
||||
|
||||
Reference in New Issue
Block a user