[FEAT] disable email delivery (#1419)

* feat: add config to disable email delivery

* chore: update config schema

* docs: add new config parameter

* test: fix test

* fix: rename email webhook event

* docs: Update backend/docs/Config.md

Co-authored-by: Lennart Fleischmann <67686424+lfleischmann@users.noreply.github.com>

---------

Co-authored-by: Lennart Fleischmann <67686424+lfleischmann@users.noreply.github.com>
This commit is contained in:
Frederic Jahn
2024-04-18 15:15:02 +02:00
committed by GitHub
parent 7276db13bb
commit def7ad37a0
13 changed files with 162 additions and 52 deletions

View File

@ -150,7 +150,7 @@ func (h *emailAdminHandler) Create(ctx echo.Context) error {
err = h.persister.GetPrimaryEmailPersisterWithConnection(tx).Create(*primaryEmail)
}
utils.NotifyUserChange(ctx, tx, h.persister, events.EmailCreate, userId)
utils.NotifyUserChange(ctx, tx, h.persister, events.UserEmailCreate, userId)
return ctx.JSON(http.StatusCreated, admin.FromEmailModel(email))
})
@ -229,7 +229,7 @@ func (h *emailAdminHandler) Delete(ctx echo.Context) error {
return fmt.Errorf("failed to delete email from db: %w", err)
}
utils.NotifyUserChange(ctx, tx, h.persister, events.EmailDelete, userId)
utils.NotifyUserChange(ctx, tx, h.persister, events.UserEmailDelete, userId)
return ctx.NoContent(http.StatusNoContent)
})
@ -275,7 +275,7 @@ func (h *emailAdminHandler) SetPrimaryEmail(ctx echo.Context) error {
return err
}
utils.NotifyUserChange(ctx, tx, h.persister, events.EmailPrimary, userId)
utils.NotifyUserChange(ctx, tx, h.persister, events.UserEmailPrimary, userId)
return ctx.NoContent(http.StatusNoContent)
})