improve email formatting and invite flow for new users

This commit is contained in:
Milo Schwartz 2024-12-31 18:25:11 -05:00
parent d244d6003b
commit d447de9e8a
No known key found for this signature in database
15 changed files with 107 additions and 89 deletions

View file

@ -6,6 +6,7 @@ import logger from "@server/logger";
export async function sendEmail(
template: ReactElement,
opts: {
name: string | undefined;
from: string | undefined;
to: string | undefined;
subject: string;
@ -23,14 +24,15 @@ export async function sendEmail(
const emailHtml = await render(template);
const options = {
from: opts.from,
await emailClient.sendMail({
from: {
name: opts.name || "Pangolin Proxy",
address: opts.from,
},
to: opts.to,
subject: opts.subject,
html: emailHtml,
};
await emailClient.sendMail(options);
});
}
export default sendEmail;