Skip to content

Commit 88d0b33

Browse files
Added types
1 parent 914d2aa commit 88d0b33

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/src/services/mail.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const transport = createTransport({
1414
requireTLS: true
1515
})
1616

17-
export const sendRegMail = async (email, username) => transport.sendMail({
17+
export const sendRegMail = async (email: string, username: string) => transport.sendMail({
1818
from: process.env.SMTP_USER,
1919
to: email,
2020
subject: "Registration Confirmation",
@@ -74,11 +74,12 @@ body {
7474
}, (err, info) => {
7575
if (err) {
7676
console.error(err);
77+
return
7778
}
7879
console.log(info.response);
7980
})
8081

81-
export const sendLoginMail = async (email, username) => transport.sendMail({
82+
export const sendLoginMail = async (email: string, username: string) => transport.sendMail({
8283
from: process.env.SMTP_USER,
8384
to: email,
8485
subject: "New login from your account",
@@ -138,6 +139,7 @@ body {
138139
}, (err, info) => {
139140
if (err) {
140141
console.error(err);
142+
return
141143
}
142144
console.log(info.response);
143145
})

0 commit comments

Comments
 (0)