From e67b2e91fbbea3894f3cf690104680c084621ed3 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Thu, 26 Aug 2021 18:53:22 +0100 Subject: [PATCH] invite: auto-append /invite if missing to url_base --- email.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/email.go b/email.go index 0556695..92b48b1 100644 --- a/email.go +++ b/email.go @@ -306,6 +306,9 @@ func (emailer *Emailer) confirmationValues(code, username, key string, app *appC } else { message := app.config.Section("messages").Key("message").String() inviteLink := app.config.Section("invite_emails").Key("url_base").String() + if !strings.HasSuffix(inviteLink, "/invite") { + inviteLink += "/invite" + } inviteLink = fmt.Sprintf("%s/%s?key=%s", inviteLink, code, key) template["helloUser"] = emailer.lang.Strings.template("helloUser", tmpl{"username": username}) template["confirmationURL"] = inviteLink