Closed hddananjaya closed 9 months ago
I was able to fix this by adding a ./
to template; as mentioned in #569
Please close this issue if not needed. Thanks.
That is actually not a complete solution, at least not for me.
What you actually have to do is update nest-cli.json
to actually copy the templates to the dist
folder
nest-cli.json
"sourceRoot": "src",
"root": "./",
"compilerOptions": {
"assets": [
{
"include": "notification/email-templates/**/*.hbs",
"outDir": "dist/src"
}
],
"watchAssets": true
}
where notification
is the directory of my module and and my templates are inside the email-templates
directory.
The path is actually copied that's why the outDir
only has dist/src
there.
however you still need to include the ./[template-name]
when trying to send an email.
I actually figured this out thanks to this discussion
tks @Subalee
Thank you @subalee
thank you @subalee
thank you @subalee
Input
OUtput in dist
@RashJrEdmund I encountered a problem with your config. It takes only the templates
folder and files with the .hbs
extension inside it, and not the images
folder and other one at the same level as the templates
.
Here is my config:
include: mail/templates/**
outDir: dist/src
Hi all, 🦄
Config:
I'm trying to use with handlebars.
App Module:
Service:
I get this error when I use templates.
I manually copied templates folder to
dist
to check whether the problem is with paths. But it asks fortemplateName
which I didn't provide.Thanks!