add optional welcome email for new users

When enabled, an email with the server URL and username will be sent to
created users. Requested in #38.
This commit is contained in:
Harvey Tindall
2021-01-24 15:19:58 +00:00
parent 406fef6595
commit ea262ca60b
12 changed files with 199 additions and 10 deletions
+4
View File
@@ -71,6 +71,9 @@ func (st *Storage) loadLang() (err error) {
// If a given language has missing values, fill it in with the english value.
func patchLang(english, other *langSection) {
if *other == nil {
*other = langSection{}
}
for n, ev := range *english {
if v, ok := (*other)[n]; !ok || v == "" {
(*other)[n] = ev
@@ -215,6 +218,7 @@ func (st *Storage) loadLangEmail() error {
patchLang(&english.PasswordReset, &lang.PasswordReset)
patchLang(&english.UserDeleted, &lang.UserDeleted)
patchLang(&english.InviteEmail, &lang.InviteEmail)
patchLang(&english.WelcomeEmail, &lang.WelcomeEmail)
}
st.lang.Email[index] = lang
return nil