mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-25 09:07:48 +00:00
26 lines
566 B
Go
26 lines
566 B
Go
|
package senders
|
||
|
|
||
|
import (
|
||
|
"github.com/caos/zitadel/internal/config/systemdefaults"
|
||
|
"github.com/caos/zitadel/internal/notification/channels"
|
||
|
"github.com/caos/zitadel/internal/notification/channels/smtp"
|
||
|
)
|
||
|
|
||
|
func EmailChannels(config systemdefaults.Notifications) (channels.NotificationChannel, error) {
|
||
|
|
||
|
debug, err := debugChannels(config)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
if !config.DebugMode {
|
||
|
p, err := smtp.InitSMTPChannel(config.Providers.Email)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return chainChannels(debug, p), nil
|
||
|
}
|
||
|
|
||
|
return debug, nil
|
||
|
}
|