form: add pre-signup card

same as the post-signup card, but shown on the sidebar.
This commit is contained in:
Harvey Tindall
2025-12-02 14:56:15 +00:00
parent a4b94b4f45
commit 6e31a7e2dd
5 changed files with 50 additions and 1 deletions
+19
View File
@@ -831,6 +831,25 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
[]byte(templated), nil, markdownRenderer),
)
}
if msg, ok := app.storage.GetCustomContentKey("PreSignupCard"); ok && msg.Enabled {
cci := customContent["PreSignupCard"]
data["preSignupCard"] = true
// We don't template here, since the username is only known after login.
templated, err := templateEmail(
msg.Content,
cci.Variables,
cci.Conditionals,
map[string]any{
"myAccountURL": userPageAddress,
},
)
if err != nil {
app.err.Printf(lm.FailedConstructCustomContent, "PreSignupCard", err)
}
data["preSignupCardContent"] = template.HTML(markdown.ToHTML(
[]byte(templated), nil, markdownRenderer),
)
}
// if discordEnabled {
// pin := ""