feat: support links in email to reset password (#3939)

This commit is contained in:
DacongDA
2025-07-12 00:18:56 +08:00
committed by GitHub
parent edd0b30e08
commit a120734bb1
6 changed files with 59 additions and 6 deletions

View File

@ -140,6 +140,9 @@ func (c *ApiController) SendEmail() {
}
content = strings.Replace(content, "%{user.friendlyName}", userString, 1)
matchContent := object.ResetLinkReg.Find([]byte(content))
content = strings.Replace(content, string(matchContent), "", -1)
for _, receiver := range emailForm.Receivers {
err = object.SendEmail(provider, emailForm.Title, content, receiver, emailForm.Sender)
if err != nil {