Class EmailNotificationChannel
java.lang.Object
io.leandev.appfuse.notification.channel.EmailNotificationChannel
- All Implemented Interfaces:
NotificationChannel
EMAIL 通道的框架預設實作
把渲染好的主旨 / HTML 內文委派給應用層的 MailDelivery 寄出(租戶郵件設定留在應用層)。
遞送例外一律轉為 DeliveryResult,交由
NotificationOutboxDispatcher 處理,不向上拋:
MailBlockedException(防火牆全擋,確定性政策封鎖)→DeliveryResult.suppressed→ Outbox 轉SUPPRESSED、不重試(重試無益)- 其他例外 →
DeliveryResult.failed(String)→ Outbox 退避重試、逾上限轉DEAD
- Since:
- 4.0.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EmailNotificationChannel
- Parameters:
mailDelivery- 應用層郵件遞送(租戶感知)
-
-
Method Details
-
type
Description copied from interface:NotificationChannel本通道處理的通道型別- Specified by:
typein interfaceNotificationChannel- Returns:
- 通道型別
-
send
Description copied from interface:NotificationChannel遞送一則訊息
實作不應拋例外表達遞送失敗,改回傳
DeliveryResult.failed(String);拋出的 runtime 例外 由NotificationOutboxDispatcher視同失敗並記錄。- Specified by:
sendin interfaceNotificationChannel- Parameters:
message- 要遞送的訊息- Returns:
- 遞送結果
-