import { ENVS } from "@/config/env.config.js"; type OtpTemplateParams = { name: string; otp: number; }; export async function sendEmail(payload: unknown): Promise { const response = fetch(ENVS.OTP_SEND_URL + "", { method: "POST", headers: { "Content-Type": "application/json", "api-key": ENVS.OTP_SEND_API_KEY!, }, body: JSON.stringify(payload), }); return response; } export function otpEmailTemplate({ name, otp }: OtpTemplateParams) { return { subject: "Verify your email - Lynfera", text: `Welcome to Lynfera! Your signup verification code is: ${otp}. This code expires in 10 minutes.`, html: `

Lynfera

Verify Your Account

Welcome to Lynfera! Use the verification code below to complete your signup. This code will expire in 10 minutes.

${otp}

If you did not request this, please ignore this email.

© 2026 Lynfera. All rights reserved.

`, }; }