Skip to content

Commit

Permalink
Merge pull request #8 from yanarp/yanarp-patch-1
Browse files Browse the repository at this point in the history
PUG and EJS adapter import
  • Loading branch information
zepochs authored Jun 25, 2020
2 parents b17b098 + f835b79 commit 533dda8
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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
Expand Down

0 comments on commit 533dda8

Please sign in to comment.