title: How to add sub folders in Mailer templates in Nest Js
body: <p>I'm quite new in Nest JS and I'm trying to send mails and I did all configuration described to @nestjs-modules/mailer, <a href="https://nest-modules.github.io/mailer/docs/mailer.html" rel="nofollow noreferrer">Here</a>. My configuration in app.module:</p>
  
  <pre><code> MailerModule.forRoot({
        transport: process.env.SENDIN_BLUE_TRANSPORTER,
        defaults: {
          from:`"${process.env.SENDIN_BLUE_SENDER_NAME}" &lt;${process.env.SENDIN_BLUE_SENDER_MAIL}&gt;`,
        },
        template: {
          dir: __dirname + '/templates',
          adapter: new PugAdapter(),
          options: {
            strict: true,
          },
        },
      }),
  </code></pre>
  
  <p>My folder structure in src:</p>
  
  <pre><code>.
  +--user
  |  +--auth
  |  +--controller
  |  +--service
  |  |  +--user.service.ts
  |  +--user.module.ts
  +--templates
  |  +--user
  |  |  +--confirm-email.pug
  |  +--email
  |  |  +--base-email.pug
  +--app.module.ts
  </code></pre>
  
  <p>I injected the MailerService and send email in this way:</p>
  
  <pre><code>const mail = await this.mailService
        .sendMail({
          to: customerPerson.per_mail,
          subject: 'Subject',
          template: 'user/confirm-mail',
          context: {
            user_name: customerPerson.per_name + ' ' + customerPerson.per_lastname,
            user_mail: customerPerson.per_mail,
            url_confirm_pass: tokenMail
          },
        })
        .then((res) =&gt; {console.log("Email:response:" , res)})
        .catch((err) =&gt; {console.log("Email:error:" , err)});
  </code></pre>
  
  <p>But then in the console I get this:</p>
  
  <pre><code>Error: ENOENT: no such file or directory, open 'user\confirm-mail.pug'
  </code></pre>
  
  <p>I don't know what's wrong in my code or if I'm missing something. I had to copy the template folder to dist because is not copied in compilation.</p>
  
  <p>Thanks in advance for any help!</p>