added missing mails.sendRecordAuthAlert jsvm binding

This commit is contained in:
Gani Georgiev 2025-11-13 10:38:33 +02:00
parent 1775585b68
commit 09d7f6a7c3
4 changed files with 5671 additions and 5663 deletions

View File

@ -663,6 +663,7 @@ func mailsBinds(vm *goja.Runtime) {
obj.Set("sendRecordVerification", mails.SendRecordVerification)
obj.Set("sendRecordChangeEmail", mails.SendRecordChangeEmail)
obj.Set("sendRecordOTP", mails.SendRecordOTP)
obj.Set("sendRecordAuthAlert", mails.SendRecordAuthAlert)
}
func securityBinds(vm *goja.Runtime) {

View File

@ -795,7 +795,7 @@ func TestMailsBindsCount(t *testing.T) {
vm := goja.New()
mailsBinds(vm)
testBindsCount(vm, "$mails", 4, t)
testBindsCount(vm, "$mails", 5, t)
}
func TestMailsBinds(t *testing.T) {
@ -833,6 +833,11 @@ func TestMailsBinds(t *testing.T) {
if (!$app.testMailer.lastMessage().html.includes("test_otp_pass")) {
throw new Error("Expected record OTP email, got:" + JSON.stringify($app.testMailer.lastMessage()))
}
$mails.sendRecordAuthAlert($app, record, "test_alert_info");
if (!$app.testMailer.lastMessage().html.includes("test_alert_info")) {
throw new Error("Expected record OTP email, got:" + JSON.stringify($app.testMailer.lastMessage()))
}
`)
if vmErr != nil {
t.Fatal(vmErr)

File diff suppressed because it is too large Load Diff

View File

@ -788,6 +788,7 @@ declare namespace $mails {
let sendRecordVerification: mails.sendRecordVerification
let sendRecordChangeEmail: mails.sendRecordChangeEmail
let sendRecordOTP: mails.sendRecordOTP
let sendRecordAuthAlert: mails.sendRecordAuthAlert
}
// -------------------------------------------------------------------