diff options
Diffstat (limited to 'experimental/embed/provider/notification.go')
| -rw-r--r-- | experimental/embed/provider/notification.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/experimental/embed/provider/notification.go b/experimental/embed/provider/notification.go new file mode 100644 index 000000000..a566cd20d --- /dev/null +++ b/experimental/embed/provider/notification.go @@ -0,0 +1,24 @@ +package provider + +import ( + "crypto/x509" + + "github.com/authelia/authelia/v4/internal/configuration/schema" + "github.com/authelia/authelia/v4/internal/notification" +) + +// NewNotificationSMTP creates a new notification.Notifier using the *notification.SMTPNotifier given a valid +// configuration. +// +// Warning: This method may panic if the provided configuration isn't validated. +func NewNotificationSMTP(config *schema.Configuration, caCertPool *x509.CertPool) notification.Notifier { + return notification.NewSMTPNotifier(config.Notifier.SMTP, caCertPool) +} + +// NewNotificationFile creates a new notification.Notifier using the *notification.FileNotifier given a valid +// configuration. +// +// Warning: This method may panic if the provided configuration isn't validated. +func NewNotificationFile(config *schema.Configuration, caCertPool *x509.CertPool) notification.Notifier { + return notification.NewSMTPNotifier(config.Notifier.SMTP, caCertPool) +} |
