From 0991db5ab87a332ab32fba557133b5a6465ad47f Mon Sep 17 00:00:00 2001
From: isra el
Date: Thu, 17 Oct 2024 09:47:15 +0300
Subject: [PATCH] chore(api): update welcome email template
---
api/src/auth/auth.service.ts | 2 ++
api/src/mail/mail.service.ts | 19 ++++++++++++----
api/src/mail/templates/welcome-1.hbs | 34 ++++++++++++++++------------
3 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/api/src/auth/auth.service.ts b/api/src/auth/auth.service.ts
index b43872c..fb3cb6a 100644
--- a/api/src/auth/auth.service.ts
+++ b/api/src/auth/auth.service.ts
@@ -71,6 +71,7 @@ export class AuthService {
subject: 'Welcome to TextBee - Lets get started!',
template: 'welcome-1',
context: { name: user.name },
+ from: 'vernu vernu@textbee.dev',
})
}
@@ -124,6 +125,7 @@ export class AuthService {
subject: 'Welcome to TextBee - Lets get started!',
template: 'welcome-1',
context: { name: user.name },
+ from: 'vernu vernu@textbee.dev',
})
const payload = { email: user.email, sub: user._id }
diff --git a/api/src/mail/mail.service.ts b/api/src/mail/mail.service.ts
index a7de98f..fb531c7 100644
--- a/api/src/mail/mail.service.ts
+++ b/api/src/mail/mail.service.ts
@@ -1,17 +1,21 @@
-import { MailerService } from '@nest-modules/mailer'
+import { ISendMailOptions, MailerService } from '@nest-modules/mailer'
import { Injectable } from '@nestjs/common'
@Injectable()
export class MailService {
constructor(private readonly mailerService: MailerService) {}
- async sendEmail({ to, subject, html }) {
- const sendMailOptions = {
+ async sendEmail({ to, subject, html, from }) {
+ const sendMailOptions: ISendMailOptions = {
to,
subject,
html,
}
+ if (from) {
+ sendMailOptions['from'] = from
+ }
+
if (process.env.MAIL_REPLY_TO) {
sendMailOptions['replyTo'] = process.env.MAIL_REPLY_TO
}
@@ -22,12 +26,17 @@ export class MailService {
}
}
- async sendEmailFromTemplate({ to, subject, template, context }) {
- const sendMailOptions = {
+ async sendEmailFromTemplate({ to, subject, template, context, from }: ISendMailOptions) {
+ const sendMailOptions: ISendMailOptions = {
to,
subject,
template,
context,
+ from,
+ }
+
+ if (from) {
+ sendMailOptions['from'] = from
}
if (process.env.MAIL_REPLY_TO) {
diff --git a/api/src/mail/templates/welcome-1.hbs b/api/src/mail/templates/welcome-1.hbs
index e41a42c..4b019c9 100644
--- a/api/src/mail/templates/welcome-1.hbs
+++ b/api/src/mail/templates/welcome-1.hbs
@@ -1,27 +1,31 @@
Hi {{name}},
-Welcome to TextBee! We’re excited to have you on board.
+My name is Vernu, and I'm the founder of TextBee.
+
-TextBee is your go-to solution for seamless SMS gateway integration, designed to help you manage your messaging needs efficiently and effectively. Whether you’re a developer, marketer, or business owner, our platform is built to scale with your needs.
+I built TextBee to help you with your messaging needs. be it sending OTP, notifications, or automated messaging workflows for your business.
+
-Here’s how you can get started:
+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. Support Our Work: Consider supporting us on Patreon to help us continue improving TextBee.
- 3. Star our repo on Github
- 3. Join the Community on discord: Connect with other users and developers, ask questions, and share ideas on our Community Forum.
-
-
-If you have any questions or need assistance, feel free to reach out to our support team at textbee.dev@gmail.com.
-
-Thank you for choosing TextBee! We look forward to helping you streamline your messaging.
+
+ - Explore our Documentation: Learn how to integrate TextBee with your existing systems in the github readme
+ - Join the Community on Discord and get help: Connect with other users and developers, ask questions, and share ideas on our Community Forum.
+ - Support Our Work: Consider supporting us on Patreon to help us continue improving TextBee.
+ - Star our repo on Github
+
+
+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.
-Best regards,
-Vernu
-
+Cheers,
+Vernu, founder
+
TextBee.dev