Nzoni docs
  • Getting Started
  • Angular
    • Project Structure
    • Authentication, Magic Link and Google Auth
    • Landing page
    • Payments and Plans
    • Blog and articles
    • User Dashboard
    • Admin Dashboard
    • SEO & SSR
    • Deploy Angular Project
  • Nest.js
    • Project Structure
    • Authentication, Google auth and Magic link
    • Blogposts
    • Plans
    • Stripe Payment
    • Email and Templates
    • Database and Migration
    • Image File upload
    • Users
    • Deploy Nest.js project
  • Node.js/MongoDB
    • Project structure
    • API endpoints
  • Angular / Firebase / Node.js
  • Create first and default plan
  • Create an Admin User
  • Support
  • Licenses
Powered by GitBook
On this page
  • All templates path
  • Set up Email environment variables in .env
  • How To send a email?
  1. Nest.js

Email and Templates

All templates path

├── node_modules
├── mail-templates
│   ├── account-created.pug            # When account is created
│   ├── failed-payment.pug             # When a subscription renew failed
│   ├── reset-password.pug             # When user request lost password
│   ├── success-payment.pug            # When a payment is successfully
│   ├── updated-subscription.pug       # When user change subscription       

Set up Email environment variables in .env

# MAILING
SMTP_HOST=
SMTP_PORT=
SMTP_SECURE=false
SMTP_AUTH=
SMTP_PASSWORD=
SMTP_FROM='"Support name" <support@domain.name>'
MODERATION_MAIL=

How To send a email?

// import user service
import { UsersService } from 'src/domains/users/users.service';
constructor(private readonly usersService: UsersService) {}

// call send email to user
await this.usersService.sendMailToUser(...)
Previous Stripe PaymentNextDatabase and Migration

Last updated 1 year ago