import React from 'react'; import { EmailTemplate } from '../types'; interface WelcomeEmailData { name: string; email: string; confirmationUrl?: string; } export const WelcomeEmailTemplate: EmailTemplate = { id: 'welcome', name: 'Welcome Email', subject: ({ name }) => `Welcome to our app, ${name}!`, preview: 'Welcome to our community', body: { html: (data) => ` Welcome

Welcome to Our App!

Hi ${data.name},

We're excited to have you join our community! Your account has been successfully created.

Here are your account details:

${data.confirmationUrl ? `

Please confirm your email address by clicking the button below:

Confirm Email ` : ''}

If you have any questions, feel free to reach out to our support team.

Best regards,
The Team

`, text: (data) => ` Welcome to Our App! Hi ${data.name}, We're excited to have you join our community! Your account has been successfully created. Here are your account details: - Email: ${data.email} ${data.confirmationUrl ? `Please confirm your email address by visiting: ${data.confirmationUrl}` : ''} If you have any questions, feel free to reach out to our support team. Best regards, The Team © 2024 Your Company. All rights reserved. `.trim(), }, }; export function WelcomeEmail(props: WelcomeEmailData) { return (

Welcome to Our App!

Hi {props.name},

We're excited to have you join our community! Your account has been successfully created.

Here are your account details:

  • Email: {props.email}
{props.confirmationUrl && ( <>

Please confirm your email address by clicking the button below:

Confirm Email )}

If you have any questions, feel free to reach out to our support team.

Best regards,
The Team

© 2024 Your Company. All rights reserved.

); }