mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
b1486a0b2a
Replace Lovable-bound email transport and auth webhook so the platform sends all automated email through its own infrastructure. - process-email-queue: drop sendLovableEmail/LOVABLE_API_KEY; send via the Hostinger Email API (primary) with automatic SMTP fallback. Shared transports added in _shared/hostinger-mail.ts and _shared/smtp-send.ts. - auth-email-hook: verify Supabase's native Send Email hook signature (Standard Webhooks via SEND_EMAIL_HOOK_SECRET) instead of Lovable's libs; build the GoTrue verify URL; keep enqueue → process-email-queue. - Recreate the 6 auth email templates under _shared/email-templates/ that previously only existed in the deployed function. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
88 lines
2.0 KiB
TypeScript
88 lines
2.0 KiB
TypeScript
/// <reference types="npm:@types/react@18.3.1" />
|
|
|
|
import * as React from 'npm:react@18.3.1'
|
|
|
|
import {
|
|
Body,
|
|
Button,
|
|
Container,
|
|
Head,
|
|
Heading,
|
|
Html,
|
|
Link,
|
|
Preview,
|
|
Text,
|
|
} from 'npm:@react-email/components@0.0.22'
|
|
|
|
interface EmailChangeEmailProps {
|
|
siteName: string
|
|
email: string
|
|
newEmail: string
|
|
confirmationUrl: string
|
|
}
|
|
|
|
export const EmailChangeEmail = ({
|
|
siteName,
|
|
email,
|
|
newEmail,
|
|
confirmationUrl,
|
|
}: EmailChangeEmailProps) => (
|
|
<Html lang="en" dir="ltr">
|
|
<Head />
|
|
<Preview>Confirm your email change for {siteName}</Preview>
|
|
<Body style={main}>
|
|
<Container style={container}>
|
|
<Heading style={h1}>Confirm your email change</Heading>
|
|
<Text style={text}>
|
|
You requested to change your email address for {siteName} from{' '}
|
|
<Link href={`mailto:${email}`} style={link}>
|
|
{email}
|
|
</Link>{' '}
|
|
to{' '}
|
|
<Link href={`mailto:${newEmail}`} style={link}>
|
|
{newEmail}
|
|
</Link>
|
|
.
|
|
</Text>
|
|
<Text style={text}>
|
|
Click the button below to confirm this change:
|
|
</Text>
|
|
<Button style={button} href={confirmationUrl}>
|
|
Confirm Email Change
|
|
</Button>
|
|
<Text style={footer}>
|
|
If you didn't request this change, please secure your account
|
|
immediately.
|
|
</Text>
|
|
</Container>
|
|
</Body>
|
|
</Html>
|
|
)
|
|
|
|
export default EmailChangeEmail
|
|
|
|
const main = { backgroundColor: '#ffffff', fontFamily: 'Arial, sans-serif' }
|
|
const container = { padding: '20px 25px' }
|
|
const h1 = {
|
|
fontSize: '22px',
|
|
fontWeight: 'bold' as const,
|
|
color: '#000000',
|
|
margin: '0 0 20px',
|
|
}
|
|
const text = {
|
|
fontSize: '14px',
|
|
color: '#55575d',
|
|
lineHeight: '1.5',
|
|
margin: '0 0 25px',
|
|
}
|
|
const link = { color: 'inherit', textDecoration: 'underline' }
|
|
const button = {
|
|
backgroundColor: '#000000',
|
|
color: '#ffffff',
|
|
fontSize: '14px',
|
|
borderRadius: '8px',
|
|
padding: '12px 20px',
|
|
textDecoration: 'none',
|
|
}
|
|
const footer = { fontSize: '12px', color: '#999999', margin: '30px 0 0' }
|