BitzOrcas 尚未包含专用的邮件基础设施。通知投递通过 Notifications 平台模块中的 INotificationDeliveryAdapter 抽象处理,默认使用 NullNotificationDeliveryAdapter(空操作)。
当前通知架构
Notifications 模块提供多通道通知框架:
NotificationService │ ▼INotificationPreferenceStore ←── 通道偏好(邮件、应用内等) │ ▼INotificationDeliveryAdapter ←── 当前为 Null,未来:SMTP/SendGrid │ ▼INotificationRepository ←── 收件箱持久化 (SqlSugar)通知类型
| 通道 | 状态 | 描述 |
|---|---|---|
| 应用内收件箱 | ✅ 已实现 | NotificationEntity 持久化到数据库 |
| 邮件 | 📋 计划中 | SMTP 或云邮件提供商适配器 |
| 短信 | 📋 计划中 | 未来扩展 |
| 推送 | 📋 计划中 | 未来扩展 |
INotificationDeliveryAdapter 端口
public interface INotificationDeliveryAdapter{ Task DeliverAsync(NotificationTemplate template, NotificationPreference preference, CancellationToken ct = default);}- 默认:
NullNotificationDeliveryAdapter— 空操作 - 计划:SMTP 适配器、SendGrid 适配器、AWS SES 适配器
添加邮件投递
要添加邮件支持,实现 INotificationDeliveryAdapter:
- 为你的邮件提供商创建包引用(例如
MailKit) - 使用 SMTP 配置实现接口
- 在 DI 中注册以替换 Null 默认值
- 配置 SMTP 设置
计划配置
{ "Mail": { "Provider": "Smtp", // 或 "SendGrid"、"SES" "Smtp": { "Host": "smtp.example.com", "Port": 587, "Username": "noreply@example.com", "Password": "..." }, "FromAddress": "noreply@bitzorcas.com", "FromName": "BitzOrcas Platform" }}另见
- Notifications 模块 — 应用内通知收件箱实现