2022-01-06 08:00:24 +00:00
|
|
|
package senders
|
|
|
|
|
|
|
|
import (
|
2022-03-07 13:22:37 +00:00
|
|
|
"context"
|
|
|
|
|
2022-04-26 23:01:45 +00: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 08:00:24 +00:00
|
|
|
)
|
|
|
|
|
2022-04-25 09:16:36 +00: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-03-07 13:22:37 +00:00
|
|
|
if twilioConfig != nil {
|
|
|
|
chain.channels = append(chain.channels, twilio.InitTwilioChannel(*twilioConfig))
|
|
|
|
}
|
2022-04-25 09:16:36 +00:00
|
|
|
chain, err = debugChannels(ctx, getFileSystemProvider, getLogProvider)
|
2022-01-06 08:00:24 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2022-03-07 13:22:37 +00:00
|
|
|
return chain, nil
|
2022-01-06 08:00:24 +00:00
|
|
|
}
|