#Nestjs not load template

5 messages · Page 1 of 1 (latest)

oak forum
#

I'm using nestjs-module/mailer. When send email, user has received email but without template. Only has subject, preview email without template. I'm search all google but not have an issue or solution. Please help me. Thanks.

alpine sequoia
#

Where do you store your templates? What does your conifugration look like? What debugging have you done? Do you expect us to just know what your code looks like, or do you plan on actually sharing with us?

oak forum
#

This my config in app module:

      transport: {
        host: 'smtp.gmail.com',
        port: 587,
        ignoreTLS: false,
        secure: false,
        auth: {
          user: process.env.GMAIL_USER,
          pass: process.env.GMAIL_PASS,
        },
      },
      defaults: {
        from: `"No Reply" <test.ai>`,
      },
      // preview: true,
      template: {
        dir: process.cwd() + '/src/templates',
        adapter: new HandlebarsAdapter(),
        options: {
          strict: true,
        },
      },
    })````
#

This my nest-cli.json

  "$schema": "https://json.schemastore.org/nest-cli",
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "deleteOutDir": true,
    "assets": [
      { "include": "i18n/**/*", "watchAssets": true },
      {
        "include": "templates/**/**",
        "outDir": "dist/src"
      }
    ]
  }
}
#

I'm check in folder dist. Template is compile, response send success