Add support use friendly name for from email

This commit is contained in:
KMKoushik
2024-07-24 13:55:12 +10:00
parent c1df1da65d
commit f10d446267

View File

@@ -19,7 +19,10 @@ export async function sendEmail(
bcc,
} = emailContent;
const fromDomain = from.split("@")[1];
let fromDomain = from.split("@")[1];
if (fromDomain?.endsWith(">")) {
fromDomain = fromDomain.slice(0, -1);
}
const domain = await db.domain.findFirst({
where: { teamId, name: fromDomain },