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
@@ -42,24 +42,16 @@ describe('ProclamationForm', () => {
isSuper: true
});
await expect
.element(page.getByRole('textbox', { name: 'Name' }))
.toBeInTheDocument();
await expect
.element(page.getByRole('combobox', { name: /^Frequency$/ }))
.toBeInTheDocument();
await expect
.element(page.getByRole('combobox', { name: /^Category$/ }))
.toBeInTheDocument();
await expect.element(page.getByRole('textbox', { name: 'Name' })).toBeInTheDocument();
await expect.element(page.getByRole('combobox', { name: /^Frequency$/ })).toBeInTheDocument();
await expect.element(page.getByRole('combobox', { name: /^Category$/ })).toBeInTheDocument();
await expect
.element(page.getByRole('combobox', { name: /^Sub-Category$/ }))
.toBeInTheDocument();
await expect
.element(page.getByRole('combobox', { name: /^Subscription Level$/ }))
.toBeInTheDocument();
await expect
.element(page.getByRole('button', { name: 'Save' }))
.toBeInTheDocument();
await expect.element(page.getByRole('button', { name: 'Save' })).toBeInTheDocument();
});
it('pre-fills name input when editing an existing record', async () => {
@@ -141,9 +133,7 @@ describe('ProclamationForm', () => {
submitLabel: 'Update'
});
await expect
.element(page.getByRole('button', { name: 'Update' }))
.toBeDisabled();
await expect.element(page.getByRole('button', { name: 'Update' })).toBeDisabled();
});
it('enables submit button when editing and user modifies a field', async () => {
@@ -157,8 +147,6 @@ describe('ProclamationForm', () => {
await page.getByRole('textbox', { name: 'Name' }).fill('New Name');
await expect
.element(page.getByRole('button', { name: 'Update' }))
.toBeEnabled();
await expect.element(page.getByRole('button', { name: 'Update' })).toBeEnabled();
});
});