Complete guide to email system with Resend, React Email templates, queue management, and delivery tracking in NextReady.
// emails/welcome-email.tsx
import {
Html,
Head,
Body,
Container,
Section,
Heading,
Text,
Button,
Hr,
Img,
} from '@react-email/components';
interface WelcomeEmailProps {
firstName?: string;
loginUrl?: string;
}
export default function WelcomeEmail({
firstName = 'there',
loginUrl = 'http://localhost:3000/signin'
}: WelcomeEmailProps) {
return (
<Html>
<Head />
<Body style={main}>
<Container style={container}>
<Section style={box}>
<Img
src="https://your-domain.com/logo.png"
width="48"
height="48"
alt="NextReady"
style={logo}
/>
<Hr style={hr} />
<Heading style={h1}>Welcome to NextReady!</Heading>
<Text style={text}>
Hi {firstName},
</Text>
<Text style={text}>
Welcome to NextReady! We're excited to have you on board.
Your account has been successfully created and you can now
start building amazing applications.
</Text>
<Button style={button} href={loginUrl}>
Sign In to Your Account
</Button>
<Text style={text}>
If you have any questions, feel free to reply to this email
or contact our support team.
</Text>
<Text style={text}>
Best regards,<br />
The NextReady Team
</Text>
<Hr style={hr} />
<Text style={footer}>
If you didn't create an account, you can safely ignore this email.
</Text>
</Section>
</Container>
</Body>
</Html>
);
}
// Styles
const main = {
backgroundColor: '#f6f9fc',
fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif',
};
const container = {
backgroundColor: '#ffffff',
margin: '0 auto',
padding: '20px 0 48px',
marginBottom: '64px',
};
const box = {
padding: '0 48px',
};
const hr = {
borderColor: '#e6ebf1',
margin: '20px 0',
};
const logo = {
margin: '0 auto',
};
const h1 = {
color: '#333',
fontSize: '24px',
fontWeight: 'bold',
margin: '40px 0',
padding: '0',
textAlign: 'center' as const,
};
const text = {
color: '#333',
fontSize: '16px',
lineHeight: '24px',
margin: '16px 0',
};
const button = {
backgroundColor: '#656ee8',
borderRadius: '5px',
color: '#fff',
display: 'inline-block',
fontSize: '16px',
fontWeight: 'bold',
lineHeight: '50px',
textAlign: 'center' as const,
textDecoration: 'none',
width: '100%',
};
const footer = {
color: '#8898aa',
fontSize: '12px',
lineHeight: '16px',
};RESEND_API_KEYRequiredResend API key for sending emails
re_AbCdEfGh_IjKlMnOpQrStUvWxYz123456789EMAIL_FROMRequiredDefault sender email address
NextReady <noreply@yourdomain.com>EMAIL_REPLY_TOOptionalReply-to email address
support@yourdomain.comSign up at resend.com and verify your account
Add and verify your sending domain with DNS records
Create an API key with sending permissions
Add RESEND_API_KEY and EMAIL_FROM to your environment variables
Your email system is configured and ready to send beautiful, reliable emails with queue processing and retry logic.