diff --git a/api/.env.example b/api/.env.example index 6bbe528..9df7716 100644 --- a/api/.env.example +++ b/api/.env.example @@ -3,6 +3,8 @@ MONGO_URI= JWT_SECRET=secret JWT_EXPIRATION=60d +FRONTEND_URL= + FIREBASE_PROJECT_ID= FIREBASE_PRIVATE_KEY_ID= FIREBASE_PRIVATE_KEY= diff --git a/api/src/auth/auth.service.ts b/api/src/auth/auth.service.ts index a77bff8..97d5e24 100644 --- a/api/src/auth/auth.service.ts +++ b/api/src/auth/auth.service.ts @@ -155,11 +155,13 @@ export class AuthService { }) passwordReset.save() + const resetLink = `${process.env.FRONTEND_URL || 'https://textbee.dev'}/reset-password?email=${encodeURIComponent(user.email)}&otp=${otp}` + await this.mailService.sendEmailFromTemplate({ to: user.email, - subject: 'Password Reset', + subject: 'textbee.dev - Password Reset', template: 'password-reset-request', - context: { name: user.name, otp }, + context: { name: user.name, resetLink, otp }, }) return { message: 'Password reset email sent' } @@ -189,7 +191,7 @@ export class AuthService { this.mailService.sendEmailFromTemplate({ to: user.email, - subject: 'Password Reset', + subject: 'textbee.dev - Password Reset', template: 'password-reset-success', context: { name: user.name }, }) diff --git a/api/src/mail/templates/password-reset-request.hbs b/api/src/mail/templates/password-reset-request.hbs index 5893847..b0a9690 100644 --- a/api/src/mail/templates/password-reset-request.hbs +++ b/api/src/mail/templates/password-reset-request.hbs @@ -1,14 +1,129 @@ -

Hello {{name}},

-

- We have received a request to reset your password. If you did not make this - request, please ignore this email. Otherwise, you can reset your password - using the OTP below. -

-
- {{otp}} -
-
- Thank you, -
- TextBee.dev -
\ No newline at end of file + + + + + +
+
+

Password Reset Request

+
+ +

Hello {{name}},

+ +

We have received a request to reset your password. If you did not make + this request, please ignore this email. Otherwise, you can reset your + password using the button below.

+ +
+ Reset Password +
+ +
+ +

If the button above doesn't work, you can copy and paste the following + link into your browser:

+

{{resetLink}}

+ +
+

Alternatively, you can use this OTP:

+
{{otp}}
+
+ +
+ + +
+ + \ No newline at end of file diff --git a/api/src/mail/templates/password-reset-success.hbs b/api/src/mail/templates/password-reset-success.hbs index bf347e2..4eefa79 100644 --- a/api/src/mail/templates/password-reset-success.hbs +++ b/api/src/mail/templates/password-reset-success.hbs @@ -1,8 +1,92 @@ -

Hello {{name}}

-

- Your password has been successfully reset. You can now login with your new password. -

-
- Thank you, -
- TextBee.dev \ No newline at end of file + + + + + +
+
+

Password Reset Successful

+
+ +

Hello {{name}},

+ +

Your password has been successfully reset. You can now login to your account using your new password.

+ +
+ + +
+ + \ No newline at end of file diff --git a/api/src/mail/templates/welcome-1.hbs b/api/src/mail/templates/welcome-1.hbs index 4b019c9..4b3146a 100644 --- a/api/src/mail/templates/welcome-1.hbs +++ b/api/src/mail/templates/welcome-1.hbs @@ -1,32 +1,127 @@ -

Hi {{name}},

-

-My name is Vernu, and I'm the founder of TextBee. -

- -I built TextBee to help you with your messaging needs. be it sending OTP, notifications, or automated messaging workflows for your business. -

- -Here are few tips to get you started:

- -

    -
  1. Explore our Documentation: Learn how to integrate TextBee with your existing systems in the github readme
  2. -
  3. Join the Community on Discord and get help: Connect with other users and developers, ask questions, and share ideas on our Community Forum.
  4. -
  5. Support Our Work: Consider supporting us on Patreon to help us continue improving TextBee.
  6. -
  7. Star our repo on Github
  8. -

    -
    - -P.S. Why did you choose TextBee? What feedback do you have?
    -Do you have any questions or need assistance?
    -Feel free to reach out to our support team at contact@textbee.dev.
    -we read and respond to all emails as quickly as possible. -

    -
    -
    -Cheers,
    -Vernu, founder
    -
    - TextBee.dev -
    + + + + + +
    +
    +

    Welcome to TextBee!

    +
    +

    Hi {{name}},

    +

    I'm Vernu, the founder of TextBee. I built this platform to help you + with all your messaging needs - whether it's sending OTPs, + notifications, or creating automated messaging workflows for your + business.

    + +
    +

    Here are a few tips to get you started:

    +
      +
    1. Explore our + Documentation + - Learn how to integrate TextBee with your existing systems
    2. +
    3. Download the Mobile App
    4. +
    5. Access your Dashboard
    6. +
    7. Join our Discord Community
    8. +
    9. Support Our Work
    10. +
    11. Star our GitHub + Repository
    12. +
    +
    + +
    + +

    + P.S. + I'd love to hear from you! Why did you choose TextBee? Do you have any + feedback or questions?
    + Feel free to reach out to our support team at + contact@textbee.dev.
    + We read and respond to all emails as quickly as possible. +

    + +
    +

    + Cheers,
    + Vernu
    + Founder, TextBee.dev +

    +
    + +
    + + +
    + + \ No newline at end of file