mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
fix(notify): handle URL parsing error in SendEmail function to prevent potential crashes
This commit is contained in:
@@ -72,6 +72,9 @@ func SendEmail(to string, emailTemplateData EmailTemplateData, options ...mail.O
|
||||
}
|
||||
|
||||
p, err := url.Parse(u.GetEnv("site.url"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
subject := i18n.TWithData(emailTemplateData.Locale, "notify_email_subject", map[string]any{
|
||||
"SiteURL": p.Host,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user