fix: route sms otp through webhook notifier

This commit is contained in:
Awuqing
2026-04-25 22:09:26 +08:00
parent 6e7a884c64
commit 1e386e1205
8 changed files with 6 additions and 225 deletions
@@ -17,7 +17,7 @@ import (
type NotificationUpsertInput struct {
Name string `json:"name" binding:"required,min=1,max=100"`
Type string `json:"type" binding:"required,oneof=email webhook telegram sms"`
Type string `json:"type" binding:"required,oneof=email webhook telegram"`
Enabled bool `json:"enabled"`
OnSuccess bool `json:"onSuccess"`
OnFailure bool `json:"onFailure"`
@@ -220,7 +220,7 @@ func (s *NotificationService) SendAuthEmailOTP(ctx context.Context, to string, c
}
func (s *NotificationService) SendAuthSMSOTP(ctx context.Context, phone string, code string) error {
return s.sendFirstByType(ctx, "sms", nil, notify.Message{
return s.sendFirstByType(ctx, "webhook", nil, notify.Message{
Title: "BackupX 登录验证码",
Body: fmt.Sprintf("BackupX 登录验证码:%s5 分钟内有效。", code),
Fields: map[string]any{