BREAKING: postgres + saas

This commit is contained in:
Vasily Zubarev
2025-04-03 13:07:54 +02:00
parent 54a892ddb0
commit f523b1f8ba
136 changed files with 3971 additions and 1563 deletions

28
lib/email.ts Normal file
View File

@@ -0,0 +1,28 @@
import { NewsletterWelcomeEmail } from "@/components/emails/newsletter-welcome-email"
import { OTPEmail } from "@/components/emails/otp-email"
import React from "react"
import { Resend } from "resend"
export const resend = new Resend(process.env.RESEND_API_KEY)
export async function sendOTPCodeEmail({ email, otp }: { email: string; otp: string }) {
const html = React.createElement(OTPEmail, { otp })
return await resend.emails.send({
from: process.env.RESEND_FROM_EMAIL!,
to: email,
subject: "Your TaxHacker verification code",
react: html,
})
}
export async function sendNewsletterWelcomeEmail(email: string) {
const html = React.createElement(NewsletterWelcomeEmail)
return await resend.emails.send({
from: process.env.RESEND_FROM_EMAIL as string,
to: email,
subject: "Welcome to TaxHacker Newsletter!",
react: html,
})
}