feat:add email send functionality

This commit is contained in:
ARJUN S THAMPI
2026-03-19 13:12:04 +05:30
parent 1bbf7f9c1c
commit 834eaad3c3
17 changed files with 759 additions and 6 deletions
+18
View File
@@ -0,0 +1,18 @@
import postmark from "postmark";
const client = new postmark.ServerClient(process.env.POSTMARK_API_KEY);
export const sendEmail = async ({to, subject, html, text}) => {
try {
await client.sendEmail({
From: process.env.EMAIL_FROM,
To: to,
Subject: subject,
HtmlBody: html,
TextBody: text || "",
MessageStream: "outbound",
});
} catch (error) {
console.error("Email send error:", error);
}
};