From f835b791e6f73ab39c0f929bf42ba486cc60451e Mon Sep 17 00:00:00 2001 From: Narp <7002920+yanarp@users.noreply.github.com> Date: Thu, 25 Jun 2020 12:15:48 +0530 Subject: [PATCH] PUG and EJS adapter import Added the example for the PUG and EJS adapter import --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee547fd..9b9c3ce 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handleba }, template: { dir: process.cwd() + '/templates/', - adapter: new HandlebarsAdapter(), // or new PugAdapter() + adapter: new HandlebarsAdapter(), // or new PugAdapter() or new EjsAdapter() options: { strict: true, }, @@ -91,6 +91,29 @@ import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handleba export class AppModule {} ``` +* We have used Handlebars in above example, for EJS and Pug use below mentioned example of adapter import + +Pug + +```javascript +//app.module.ts +import { Module } from '@nestjs/common'; +import { MailerModule } from '@nestjs-modules/mailer'; +import { PugAdapter } from '@nestjs-modules/mailer/dist/adapters/pug.adapter'; + +``` + +EJS + +```javascript +//app.module.ts +import { Module } from '@nestjs/common'; +import { MailerModule } from '@nestjs-modules/mailer'; +import { EjsAdapter } from '@nestjs-modules/mailer/dist/adapters/ejs.adapter'; + +``` + + After this, MailerService will be available to inject across entire project, for example in this way : ```typescript