@ideal-photography/shared
Version:
Shared MongoDB and utility logic for Ideal Photography PWAs: users, products, services, bookings, orders/cart, galleries, reviews, notifications, campaigns, settings, audit logs, minimart items/orders, and push notification subscriptions.
194 lines (155 loc) • 8.22 kB
JavaScript
/**
* Centralized email templates
*/
export function buildWelcomeEmail({ name, email }) {
const html = `
<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;">
<div style="background-color: #A24CF3; color: white; padding: 20px; text-align: center;">
<h1 style="margin: 0;">Welcome to IDEAS MEDIA COMPANY</h1>
</div>
<div style="padding: 30px 20px;">
<h2 style="color: #A24CF3;">Welcome, ${name}!</h2>
<p>Thank you for joining IDEAS MEDIA COMPANY. We're excited to have you on board!</p>
<p>You can now access our services and start exploring what we have to offer.</p>
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
<h3 style="color: #A24CF3; margin-top: 0;">Next Steps:</h3>
<ul>
<li>Complete your profile setup</li>
<li>Explore our services</li>
<li>Contact us if you have any questions</li>
</ul>
</div>
<p style="margin-top: 30px;">
Best regards,<br>
<strong>IDEAS MEDIA COMPANY Team</strong>
</p>
</div>
<div style="background-color: #f8f9fa; padding: 15px; text-align: center; color: #666; font-size: 12px;">
<p style="margin: 0;">© 2024 IDEAS MEDIA COMPANY. All rights reserved.</p>
</div>
</div>
`;
const text = `
Welcome to IDEAS MEDIA COMPANY
Welcome, ${name}!
Thank you for joining IDEAS MEDIA COMPANY. We're excited to have you on board!
You can now access our services and start exploring what we have to offer.
Next Steps:
- Complete your profile setup
- Explore our services
- Contact us if you have any questions
Best regards,
IDEAS MEDIA COMPANY Team
© 2024 IDEAS MEDIA COMPANY. All rights reserved.
`;
return { html, text };
}
export function buildVerificationEmail({ name, url }) {
const html = `
<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;">
<div style="background-color: #A24CF3; color: white; padding: 20px; text-align: center;">
<h1 style="margin: 0;">Verify Your Email</h1>
</div>
<div style="padding: 30px 20px;">
<h2 style="color: #A24CF3;">Hello ${name}!</h2>
<p>Please verify your email address by clicking the button below:</p>
<div style="text-align: center; margin: 30px 0;">
<a href="${url}" style="background-color: #A24CF3; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;">Verify Email</a>
</div>
<p>If the button doesn't work, you can copy and paste this link into your browser:</p>
<p style="word-break: break-all; color: #666;">${url}</p>
<p style="margin-top: 30px;">
Best regards,<br>
<strong>IDEAS MEDIA COMPANY Team</strong>
</p>
</div>
</div>
`;
const text = `
Verify Your Email
Hello ${name}!
Please verify your email address by visiting this link:
${url}
Best regards,
IDEAS MEDIA COMPANY Team
`;
return { html, text };
}
export function buildResetPasswordEmail({ name, url }) {
const html = `
<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;">
<div style="background-color: #A24CF3; color: white; padding: 20px; text-align: center;">
<h1 style="margin: 0;">Reset Your Password</h1>
</div>
<div style="padding: 30px 20px;">
<h2 style="color: #A24CF3;">Hello ${name}!</h2>
<p>You requested to reset your password. Click the button below to create a new password:</p>
<div style="text-align: center; margin: 30px 0;">
<a href="${url}" style="background-color: #A24CF3; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;">Reset Password</a>
</div>
<p>If you didn't request this, please ignore this email.</p>
<p style="margin-top: 30px;">
Best regards,<br>
<strong>IDEAS MEDIA COMPANY Team</strong>
</p>
</div>
</div>
`;
const text = `
Reset Your Password
Hello ${name}!
You requested to reset your password. Visit this link to create a new password:
${url}
If you didn't request this, please ignore this email.
Best regards,
IDEAS MEDIA COMPANY Team
`;
return { html, text };
}
export function buildBookingConfirmationEmail({ name, bookingDetails, confirmationUrl }) {
const html = `
<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;">
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; text-align: center; border-radius: 10px 10px 0 0;">
<h1 style="margin: 0; font-size: 28px;">Booking Confirmed!</h1>
<p style="margin: 10px 0 0 0; font-size: 16px; opacity: 0.9;">Your photography session has been successfully booked</p>
</div>
<div style="background: #f8f9fa; padding: 30px; border-radius: 0 0 10px 10px;">
<h2 style="color: #333; margin-top: 0;">Hello ${name}!</h2>
<p style="color: #666; line-height: 1.6;">We are excited to confirm your photography session with IDEAS MEDIA COMPANY. Here are your booking details:</p>
<div style="background: white; padding: 20px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #667eea;">
<h3 style="color: #333; margin-top: 0;">Booking Details</h3>
<p><strong>Session Type:</strong> ${bookingDetails.type || "Photography Session"}</p>
<p><strong>Date:</strong> ${bookingDetails.date || "TBD"}</p>
<p><strong>Time:</strong> ${bookingDetails.time || "TBD"}</p>
<p><strong>Duration:</strong> ${bookingDetails.duration || "TBD"}</p>
<p><strong>Location:</strong> ${bookingDetails.location || "TBD"}</p>
<p><strong>Total Amount:</strong> ${bookingDetails.amount || "TBD"}</p>
</div>
<p style="color: #666; line-height: 1.6;">We will be in touch soon with more details about your session. If you have any questions, please do not hesitate to contact us.</p>
<div style="text-align: center; margin: 30px 0;">
<a href="${confirmationUrl || "#"}" style="background: #667eea; color: white; padding: 12px 30px; text-decoration: none; border-radius: 5px; display: inline-block; font-weight: bold;">View Booking Details</a>
</div>
<p style="color: #999; font-size: 14px; text-align: center; margin-top: 30px;">
Best regards,<br>
IDEAS MEDIA COMPANY Team
</p>
</div>
</div>
`;
const text = `
Booking Confirmed!
Hello ${name}!
We are excited to confirm your photography session with IDEAS MEDIA COMPANY.
Booking Details:
- Session Type: ${bookingDetails.type || "Photography Session"}
- Date: ${bookingDetails.date || "TBD"}
- Time: ${bookingDetails.time || "TBD"}
- Duration: ${bookingDetails.duration || "TBD"}
- Location: ${bookingDetails.location || "TBD"}
- Total Amount: ${bookingDetails.amount || "TBD"}
We will be in touch soon with more details about your session.
Best regards,
IDEAS MEDIA COMPANY Team
`;
return { html, text };
}