Interface NotificationPreferenceFilter
- All Known Implementing Classes:
DbNotificationPreferenceFilter
public interface NotificationPreferenceFilter
通知偏好過濾 SPI(選用;Phase 2 opt-out)
NotificationService 在展開每則「收件人 × 通道」前詢問本 SPI 是否該送。預設語意應為 opt-out
(無明確設定即視為啟用),讓使用者只在想關閉某型別/通道時才設定。框架提供
DbNotificationPreferenceFilter 為 DB-backed 預設;
未注入時 NotificationService 視同全部啟用。
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnabled(String type, Recipient recipient, ChannelType channel, String tenantId) 此收件人是否願意以此通道收到此型別的通知
-
Method Details
-
isEnabled
此收件人是否願意以此通道收到此型別的通知- Parameters:
type- 通知型別鍵recipient- 收件人(userId為 null 時通常無從查偏好,實作宜回 true)channel- 通道tenantId- 所屬租戶(可為 null)- Returns:
- true = 送;false = 略過此收件人×通道
-