mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
024eedc1b5
* feat: enable default smtp config on setup * fix tests * fix channel order Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
21 lines
860 B
Go
21 lines
860 B
Go
package senders
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/notification/channels"
|
|
"github.com/zitadel/zitadel/internal/notification/channels/fs"
|
|
"github.com/zitadel/zitadel/internal/notification/channels/log"
|
|
"github.com/zitadel/zitadel/internal/notification/channels/smtp"
|
|
)
|
|
|
|
func EmailChannels(ctx context.Context, emailConfig func(ctx context.Context) (*smtp.EmailConfig, error), getFileSystemProvider func(ctx context.Context) (*fs.FSConfig, error), getLogProvider func(ctx context.Context) (*log.LogConfig, error)) (chain *Chain, err error) {
|
|
channels := make([]channels.NotificationChannel, 0, 3)
|
|
p, err := smtp.InitSMTPChannel(ctx, emailConfig)
|
|
if err == nil {
|
|
channels = append(channels, p)
|
|
}
|
|
channels = append(channels, debugChannels(ctx, getFileSystemProvider, getLogProvider)...)
|
|
return chainChannels(channels...), nil
|
|
}
|