mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
feat: add http as smtp provider (#8545)
# Which Problems Are Solved Send Email messages as a HTTP call to a relay, for own logic on handling different Email providers # How the Problems Are Solved Create endpoints under Email provider to manage SMTP and HTTP in the notification handlers. # Additional Changes Clean up old logic in command and query side to handle the general Email providers with deactivate, activate and remove. # Additional Context Partially closes #8270 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/notification/channels/email"
|
||||
"github.com/zitadel/zitadel/internal/notification/channels/sms"
|
||||
"github.com/zitadel/zitadel/internal/notification/channels/smtp"
|
||||
"github.com/zitadel/zitadel/internal/notification/channels/webhook"
|
||||
"github.com/zitadel/zitadel/internal/notification/handlers"
|
||||
"github.com/zitadel/zitadel/internal/notification/senders"
|
||||
@@ -62,20 +62,20 @@ func registerCounter(counter, desc string) {
|
||||
logging.WithFields("metric", counter).OnError(err).Panic("unable to register counter")
|
||||
}
|
||||
|
||||
func (c *channels) Email(ctx context.Context) (*senders.Chain, *smtp.Config, error) {
|
||||
smtpCfg, err := c.q.GetSMTPConfig(ctx)
|
||||
func (c *channels) Email(ctx context.Context) (*senders.Chain, *email.Config, error) {
|
||||
emailCfg, err := c.q.GetActiveEmailConfig(ctx)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
chain, err := senders.EmailChannels(
|
||||
ctx,
|
||||
smtpCfg,
|
||||
emailCfg,
|
||||
c.q.GetFileSystemProvider,
|
||||
c.q.GetLogProvider,
|
||||
c.counters.success.email,
|
||||
c.counters.failed.email,
|
||||
)
|
||||
return chain, smtpCfg, err
|
||||
return chain, emailCfg, err
|
||||
}
|
||||
|
||||
func (c *channels) SMS(ctx context.Context) (*senders.Chain, *sms.Config, error) {
|
||||
|
Reference in New Issue
Block a user