mirror of
https://github.com/teamhanko/hanko.git
synced 2025-10-28 23:30:15 +08:00
[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:
@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user