mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:47:32 +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:
@@ -256,7 +256,7 @@ func prepareSMSConfigQuery(ctx context.Context, db prepareDatabase) (sq.SelectBu
|
||||
&twilioConfig.token,
|
||||
&twilioConfig.senderNumber,
|
||||
|
||||
&httpConfig.smsID,
|
||||
&httpConfig.id,
|
||||
&httpConfig.endpoint,
|
||||
)
|
||||
|
||||
@@ -268,7 +268,7 @@ func prepareSMSConfigQuery(ctx context.Context, db prepareDatabase) (sq.SelectBu
|
||||
}
|
||||
|
||||
twilioConfig.set(config)
|
||||
httpConfig.set(config)
|
||||
httpConfig.setSMS(config)
|
||||
|
||||
return config, nil
|
||||
}
|
||||
@@ -322,7 +322,7 @@ func prepareSMSConfigsQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
|
||||
&twilioConfig.token,
|
||||
&twilioConfig.senderNumber,
|
||||
|
||||
&httpConfig.smsID,
|
||||
&httpConfig.id,
|
||||
&httpConfig.endpoint,
|
||||
|
||||
&configs.Count,
|
||||
@@ -333,7 +333,7 @@ func prepareSMSConfigsQuery(ctx context.Context, db prepareDatabase) (sq.SelectB
|
||||
}
|
||||
|
||||
twilioConfig.set(config)
|
||||
httpConfig.set(config)
|
||||
httpConfig.setSMS(config)
|
||||
|
||||
configs.Configs = append(configs.Configs, config)
|
||||
}
|
||||
@@ -361,12 +361,12 @@ func (c sqlTwilioConfig) set(smsConfig *SMSConfig) {
|
||||
}
|
||||
|
||||
type sqlHTTPConfig struct {
|
||||
smsID sql.NullString
|
||||
id sql.NullString
|
||||
endpoint sql.NullString
|
||||
}
|
||||
|
||||
func (c sqlHTTPConfig) set(smsConfig *SMSConfig) {
|
||||
if !c.smsID.Valid {
|
||||
func (c sqlHTTPConfig) setSMS(smsConfig *SMSConfig) {
|
||||
if !c.id.Valid {
|
||||
return
|
||||
}
|
||||
smsConfig.HTTPConfig = &HTTP{
|
||||
|
Reference in New Issue
Block a user