Browse Source

chore(api): update welcome email template

legacy-ui
isra el 1 year ago
parent
commit
0991db5ab8
  1. 2
      api/src/auth/auth.service.ts
  2. 19
      api/src/mail/mail.service.ts
  3. 34
      api/src/mail/templates/welcome-1.hbs

2
api/src/auth/auth.service.ts

@ -71,6 +71,7 @@ export class AuthService {
subject: 'Welcome to TextBee - Lets get started!', subject: 'Welcome to TextBee - Lets get started!',
template: 'welcome-1', template: 'welcome-1',
context: { name: user.name }, context: { name: user.name },
from: 'vernu vernu@textbee.dev',
}) })
} }
@ -124,6 +125,7 @@ export class AuthService {
subject: 'Welcome to TextBee - Lets get started!', subject: 'Welcome to TextBee - Lets get started!',
template: 'welcome-1', template: 'welcome-1',
context: { name: user.name }, context: { name: user.name },
from: 'vernu vernu@textbee.dev',
}) })
const payload = { email: user.email, sub: user._id } const payload = { email: user.email, sub: user._id }

19
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' import { Injectable } from '@nestjs/common'
@Injectable() @Injectable()
export class MailService { export class MailService {
constructor(private readonly mailerService: MailerService) {} constructor(private readonly mailerService: MailerService) {}
async sendEmail({ to, subject, html }) {
const sendMailOptions = {
async sendEmail({ to, subject, html, from }) {
const sendMailOptions: ISendMailOptions = {
to, to,
subject, subject,
html, html,
} }
if (from) {
sendMailOptions['from'] = from
}
if (process.env.MAIL_REPLY_TO) { if (process.env.MAIL_REPLY_TO) {
sendMailOptions['replyTo'] = 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, to,
subject, subject,
template, template,
context, context,
from,
}
if (from) {
sendMailOptions['from'] = from
} }
if (process.env.MAIL_REPLY_TO) { if (process.env.MAIL_REPLY_TO) {

34
api/src/mail/templates/welcome-1.hbs

@ -1,27 +1,31 @@
<h1>Hi {{name}},</h1> <h1>Hi {{name}},</h1>
<p> <p>
Welcome to TextBee! We’re excited to have you on board. <br /><br />
My name is Vernu, and I'm the founder of TextBee.
<br /><br />
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. <br/><br />
I built TextBee to help you with your messaging needs. be it sending OTP, notifications, or automated messaging workflows for your business.
<br/><br/>
Here’s how you can get started: <br/><br />
Here are few tips to get you started: <br/><br />
1. <a href="https://github.com/vernu/textbee">Explore our Documentation: Learn how to integrate TextBee with your existing systems in the github readme</a> <br/>
2. <a href="https://www.patreon.com/vernu">Support Our Work: Consider supporting us on Patreon to help us continue improving TextBee.</a> <br/>
3. Star our repo on <a href="https://github.com/vernu/textbee">Github</a> <br/>
3. <a href="https://discord.gg/d7vyfBpWbQ"> Join the Community on discord</a>: Connect with other users and developers, ask questions, and share ideas on our Community Forum. <br/>
<br />
If you have any questions or need assistance, feel free to reach out to our support team at <a href="mailto:textbee.dev@gmail.com">textbee.dev@gmail.com</a>. <br/><br />
Thank you for choosing TextBee! We look forward to helping you streamline your messaging. <br/><br />
<ol start="1">
<li><a href="https://github.com/vernu/textbee">Explore our Documentation: Learn how to integrate TextBee with your existing systems in the github readme</a></li>
<li><a href="https://discord.gg/d7vyfBpWbQ">Join the Community on Discord and get help: Connect with other users and developers, ask questions, and share ideas on our Community Forum.</a></li>
<li><a href="https://www.patreon.com/vernu">Support Our Work: Consider supporting us on Patreon to help us continue improving TextBee.</a></li>
<li><a href="https://github.com/vernu/textbee">Star our repo on Github</a></li>
<br /> <br/>
<hr/>
P.S. Why did you choose TextBee? What feedback do you have? <br/>
Do you have any questions or need assistance? <br/>
Feel free to reach out to our support team at <a href="mailto:contact@textbee.dev">contact@textbee.dev</a>. <br/>
we read and respond to all emails as quickly as possible.
</p> </p>
<hr/> <hr/>
<div> <div>
Best regards, <br />
Vernu <br />
<br />
Cheers, <br />
Vernu, founder <br />
<br />
<i>TextBee.dev</i> <i>TextBee.dev</i>
</div> </div>

Loading…
Cancel
Save