Browse Source

feat(api): send welcome emails on signup

pull/19/head
isra el 2 years ago
parent
commit
d2ab8944e7
  1. 13
      api/src/auth/auth.service.ts
  2. 28
      api/src/mail/templates/welcome-1.hbs

13
api/src/auth/auth.service.ts

@ -66,6 +66,12 @@ export class AuthService {
name,
email,
})
this.mailService.sendEmailFromTemplate({
to: user.email,
subject: 'Welcome to TextBee - Lets get started!',
template: 'welcome-1',
context: { name: user.name },
})
}
if (user.googleId !== googleId) {
@ -113,6 +119,13 @@ export class AuthService {
user.lastLoginAt = new Date()
await user.save()
this.mailService.sendEmailFromTemplate({
to: user.email,
subject: 'Welcome to TextBee - Lets get started!',
template: 'welcome-1',
context: { name: user.name },
})
const payload = { email: user.email, sub: user._id }
return {

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

@ -0,0 +1,28 @@
<h1>Hi {{name}},</h1>
<p>
Welcome to TextBee! We’re excited to have you on board. <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 />
Here’s how you can get 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. Join the Community on discord: 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 />
</p>
<hr/>
<div>
Best regards, <br />
Vernu <br />
<br />
<i>TextBee.dev</i>
</div>
Loading…
Cancel
Save