mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-28 21:57:23 +02:00
✨ Translations for Email Notifications (#1278)
Co-authored-by: Niko Heller <hellerniko@gmail.com>
This commit is contained in:
parent
aa52a0f26f
commit
f4218c3115
51 changed files with 1071 additions and 970 deletions
|
@ -22,7 +22,7 @@ import { env } from "@/env";
|
|||
import { absoluteUrl } from "@/utils/absolute-url";
|
||||
import { CustomPrismaAdapter } from "@/utils/auth/custom-prisma-adapter";
|
||||
import { mergeGuestsIntoUser } from "@/utils/auth/merge-user";
|
||||
import { emailClient } from "@/utils/emails";
|
||||
import { getEmailClient } from "@/utils/emails";
|
||||
import { getValueByPath } from "@/utils/get-value-by-path";
|
||||
|
||||
const providers: Provider[] = [
|
||||
|
@ -90,21 +90,23 @@ const providers: Provider[] = [
|
|||
},
|
||||
select: {
|
||||
name: true,
|
||||
locale: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (user) {
|
||||
await emailClient.sendTemplate("LoginEmail", {
|
||||
to: email,
|
||||
subject: `${token} is your 6-digit code`,
|
||||
props: {
|
||||
name: user.name,
|
||||
magicLink: absoluteUrl("/auth/login", {
|
||||
magicLink: url,
|
||||
}),
|
||||
code: token,
|
||||
await getEmailClient(user.locale ?? undefined).sendTemplate(
|
||||
"LoginEmail",
|
||||
{
|
||||
to: email,
|
||||
props: {
|
||||
magicLink: absoluteUrl("/auth/login", {
|
||||
magicLink: url,
|
||||
}),
|
||||
code: token,
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue