feat: wire GHL webhook to Resend email templates

- Replace raw Resend text emails with sendMail using Resend templates
- automated-user-registration template: firstName, tempPassword,
  verifyUrl, loginUrl
- license-key-delivery template: firstName, license_key
- Remove requestPasswordReset call (temp password is the one-time
  credential; verification link handles email confirmation)
- Add .catch() to Better Auth email callbacks to prevent unhandled
  rejections from missing templates crashing the server
This commit is contained in:
NeilClack
2026-07-08 15:01:08 -05:00
parent e6ef7d3b36
commit 55a29b9c1a
29 changed files with 26572 additions and 21641 deletions
+4
View File
@@ -17,6 +17,8 @@ export const auth = betterAuth({
void sendVerificationEmail({
email: user.email,
token
}).catch((e) => {
console.error('sendVerificationEmail template email failed:', e);
});
}
},
@@ -31,6 +33,8 @@ export const auth = betterAuth({
target_email_address: user.email,
reset_link: url
}
}).catch((e) => {
console.error('sendResetPassword template email failed:', e);
});
}
},