From da4470bc4fbc16ebc9b02733844e3270079f80bc Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 5 Nov 2024 22:53:09 +0000 Subject: [PATCH] admin: store email on manual account creation another mistake from the rewrite of account creation stuff. Should fix issue #374, sorry for taking so long. --- api-users.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api-users.go b/api-users.go index 3c29f2d..e865b27 100644 --- a/api-users.go +++ b/api-users.go @@ -53,6 +53,14 @@ func (app *appContext) NewUserFromAdmin(gc *gin.Context) { nu.Log() } + if emailEnabled && req.Email != "" { + emailStore := EmailAddress{ + Addr: req.Email, + Contact: true, + } + app.storage.SetEmailsKey(nu.User.ID, emailStore) + } + welcomeMessageSentIfNecessary := true if nu.Created { welcomeMessageSentIfNecessary = app.WelcomeNewUser(nu.User, time.Time{})