[#7314] added ALERT_INFO placeholder to the auth alert mail template

This commit is contained in:
Gani Georgiev
2025-11-10 17:56:36 +02:00
parent 423d234da1
commit 0f5411d81c
40 changed files with 137 additions and 60 deletions

View File

@@ -12,10 +12,12 @@ import (
)
// SendRecordAuthAlert sends a new device login alert to the specified auth record.
func SendRecordAuthAlert(app core.App, authRecord *core.Record) error {
func SendRecordAuthAlert(app core.App, authRecord *core.Record, info string) error {
mailClient := app.NewMailClient()
subject, body, err := resolveEmailTemplate(app, authRecord, authRecord.Collection().AuthAlert.EmailTemplate, nil)
subject, body, err := resolveEmailTemplate(app, authRecord, authRecord.Collection().AuthAlert.EmailTemplate, map[string]any{
core.EmailPlaceholderAlertInfo: info,
})
if err != nil {
return err
}