mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-02 17:14:55 +02:00
improve email formatting and invite flow for new users
This commit is contained in:
parent
d244d6003b
commit
d447de9e8a
15 changed files with 107 additions and 89 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue