Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finwise-miniapp-be
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ThinhNC
finwise-miniapp-be
Commits
50ef841e
Commit
50ef841e
authored
Jul 23, 2026
by
ThinhNC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: implement MailService and configuration for email notifications
parent
7cdcb77c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
.env.example
.env.example
+9
-1
mail.service.ts
src/common/services/mail.service.ts
+1
-1
mail.config.ts
src/config/mail.config.ts
+4
-1
No files found.
.env.example
View file @
50ef841e
...
...
@@ -15,3 +15,11 @@ JWT_REFRESH_EXPIRES_IN=7d
REDIS_HOST=redis
REDIS_PORT=6381
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_SECURE=false
MAIL_USER=your_gmail_user@gmail.com
MAIL_PASS=your_gmail_app_password
MAIL_FROM="FinWise <noreply@gmail.com>"
APP_URL=http://localhost:7777
\ No newline at end of file
src/common/services/mail.service.ts
View file @
50ef841e
...
...
@@ -57,7 +57,7 @@ export class MailService {
}
async
sendPasswordResetEmail
(
email
:
string
,
token
:
string
,
fullName
?:
string
)
{
const
resetUrl
=
`
${
mailConfig
.
verificationUrl
.
replace
(
'verify-email'
,
'reset-password'
)
}
?token=
${
token
}
`
;
const
resetUrl
=
`
${
mailConfig
.
resetPasswordUrl
}
?token=
${
token
}
`
;
const
mailOptions
=
{
from
:
mailConfig
.
from
,
to
:
email
,
...
...
src/config/mail.config.ts
View file @
50ef841e
const
appUrl
=
process
.
env
.
APP_URL
||
'http://localhost:7777'
;
export
const
mailConfig
=
{
host
:
process
.
env
.
MAIL_HOST
||
'smtp.gmail.com'
,
port
:
parseInt
(
process
.
env
.
MAIL_PORT
||
'587'
,
10
),
...
...
@@ -7,5 +9,6 @@ export const mailConfig = {
pass
:
process
.
env
.
MAIL_PASS
||
''
,
},
from
:
process
.
env
.
MAIL_FROM
||
'FinWise <noreply@gmail.com>'
,
verificationUrl
:
process
.
env
.
MAIL_VERIFICATION_URL
||
'http://localhost:7777/api/v1/auth/verify-email'
,
verificationUrl
:
`
${
appUrl
}
/api/v1/auth/verify-email`
,
resetPasswordUrl
:
`
${
appUrl
}
/api/v1/auth/reset-password`
,
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment