Skip to content

Commit 02a6bc5

Browse files
authored
Merge pull request #1 from Hombre2014/dev
Add my own domain for mail sent.
2 parents 34f43db + ec37e48 commit 02a6bc5

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

lib/mail.ts

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,36 @@
1-
import { Resend } from "resend";
1+
import { Resend } from 'resend';
22

33
const resend = new Resend(process.env.RESEND_API_KEY);
44

55
const domain = process.env.NEXT_PUBLIC_APP_URL;
66

7-
export const sendTwoFactorTokenEmail = async (
8-
email: string,
9-
token: string
10-
) => {
7+
export const sendTwoFactorTokenEmail = async (email: string, token: string) => {
118
await resend.emails.send({
12-
from: "mail@auth-masterclass-tutorial.com",
9+
from: 'mytools@my-tools.ai',
1310
to: email,
14-
subject: "2FA Code",
15-
html: `<p>Your 2FA code: ${token}</p>`
11+
subject: '2FA Code',
12+
html: `<p>Your 2FA code: ${token}</p>`,
1613
});
1714
};
1815

19-
export const sendPasswordResetEmail = async (
20-
email: string,
21-
token: string,
22-
) => {
23-
const resetLink = `${domain}/auth/new-password?token=${token}`
16+
export const sendPasswordResetEmail = async (email: string, token: string) => {
17+
const resetLink = `${domain}/auth/new-password?token=${token}`;
2418

2519
await resend.emails.send({
26-
from: "mail@auth-masterclass-tutorial.com",
20+
from: 'mytools@my-tools.ai',
2721
to: email,
28-
subject: "Reset your password",
29-
html: `<p>Click <a href="${resetLink}">here</a> to reset password.</p>`
22+
subject: 'Reset your password',
23+
html: `<p>Click <a href="${resetLink}">here</a> to reset password.</p>`,
3024
});
3125
};
3226

33-
export const sendVerificationEmail = async (
34-
email: string,
35-
token: string
36-
) => {
27+
export const sendVerificationEmail = async (email: string, token: string) => {
3728
const confirmLink = `${domain}/auth/new-verification?token=${token}`;
3829

3930
await resend.emails.send({
40-
from: "mail@auth-masterclass-tutorial.com",
31+
from: 'mytools@my-tools.ai',
4132
to: email,
42-
subject: "Confirm your email",
43-
html: `<p>Click <a href="${confirmLink}">here</a> to confirm email.</p>`
33+
subject: 'Confirm your email',
34+
html: `<p>Click <a href="${confirmLink}">here</a> to confirm email.</p>`,
4435
});
4536
};

0 commit comments

Comments
 (0)