|
1 |
| -import { Resend } from "resend"; |
| 1 | +import { Resend } from 'resend'; |
2 | 2 |
|
3 | 3 | const resend = new Resend(process.env.RESEND_API_KEY);
|
4 | 4 |
|
5 | 5 | const domain = process.env.NEXT_PUBLIC_APP_URL;
|
6 | 6 |
|
7 |
| -export const sendTwoFactorTokenEmail = async ( |
8 |
| - email: string, |
9 |
| - token: string |
10 |
| -) => { |
| 7 | +export const sendTwoFactorTokenEmail = async (email: string, token: string) => { |
11 | 8 | await resend.emails.send({
|
12 |
| - from: "mail@auth-masterclass-tutorial.com", |
| 9 | + from: 'mytools@my-tools.ai', |
13 | 10 | 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>`, |
16 | 13 | });
|
17 | 14 | };
|
18 | 15 |
|
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}`; |
24 | 18 |
|
25 | 19 | await resend.emails.send({
|
26 |
| - from: "mail@auth-masterclass-tutorial.com", |
| 20 | + from: 'mytools@my-tools.ai', |
27 | 21 | 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>`, |
30 | 24 | });
|
31 | 25 | };
|
32 | 26 |
|
33 |
| -export const sendVerificationEmail = async ( |
34 |
| - email: string, |
35 |
| - token: string |
36 |
| -) => { |
| 27 | +export const sendVerificationEmail = async (email: string, token: string) => { |
37 | 28 | const confirmLink = `${domain}/auth/new-verification?token=${token}`;
|
38 | 29 |
|
39 | 30 | await resend.emails.send({
|
40 |
| - from: "mail@auth-masterclass-tutorial.com", |
| 31 | + from: 'mytools@my-tools.ai', |
41 | 32 | 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>`, |
44 | 35 | });
|
45 | 36 | };
|
0 commit comments