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:
@@ -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);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user