2022-01-06 09:00:24 +01:00
|
|
|
package senders
|
|
|
|
|
|
|
|
import (
|
2022-03-07 14:22:37 +01:00
|
|
|
"context"
|
|
|
|
|
2022-05-13 14:13:07 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/notification/channels"
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/notification/channels/fs"
|
|
|
|
"github.com/zitadel/zitadel/internal/notification/channels/log"
|
|
|
|
"github.com/zitadel/zitadel/internal/notification/channels/twilio"
|
2022-01-06 09:00:24 +01:00
|
|
|
)
|
|
|
|
|
2022-04-25 11:16:36 +02:00
|
|
|
func SMSChannels(ctx context.Context, twilioConfig *twilio.TwilioConfig, getFileSystemProvider func(ctx context.Context) (*fs.FSConfig, error), getLogProvider func(ctx context.Context) (*log.LogConfig, error)) (chain *Chain, err error) {
|
2022-05-13 14:13:07 +02:00
|
|
|
channels := make([]channels.NotificationChannel, 0, 3)
|
2022-03-07 14:22:37 +01:00
|
|
|
if twilioConfig != nil {
|
2022-05-13 14:13:07 +02:00
|
|
|
channels = append(channels, twilio.InitTwilioChannel(*twilioConfig))
|
2022-03-07 14:22:37 +01:00
|
|
|
}
|
2022-05-13 14:13:07 +02:00
|
|
|
channels = append(channels, debugChannels(ctx, getFileSystemProvider, getLogProvider)...)
|
|
|
|
return chainChannels(channels...), nil
|
2022-01-06 09:00:24 +01:00
|
|
|
}
|