Hi, thanks a lot for the initiative of open sourcing this adapter, it has given me a direction on how integrate the React Email with NestJS.
But i had some issues on how setup this at first.
Here some points i think the instructions should be improved. In my case i configured the templates directory at src/emails/templates, containing the tsx files with react email templates.
A base point i have done were to setup swc builder with swc-loader and updating the test rules with test: /\.(tsx|ts|js|cjs|mjs)$/, at webpack.config.js
With this setup, is even not necessary run yarn emails:export, each time the server hot reloads on development mode, the templates are updated on dist/emails/templates.
By end, i had to do 2 updates on your adapter implementation:
With a console log, i noticed that this generic import were receiving a undefined, i updated from tmpl.default.default to tmpl.default
Looking at the docs, as this is a NodeJS backend project, i updated from JSX Tag notation to function call, to avoid some errors..
Hi, thanks a lot for the initiative of open sourcing this adapter, it has given me a direction on how integrate the React Email with NestJS.
But i had some issues on how setup this at first.
Here some points i think the instructions should be improved. In my case i configured the templates directory at
src/emails/templates
, containing thetsx
files with react email templates.A base point i have done were to setup swc builder with
swc-loader
and updating the test rules withtest: /\.(tsx|ts|js|cjs|mjs)$/,
atwebpack.config.js
Also, i had to setup a
.swcrc
file, updating the sample withtsx=true
Also, is important to have
jsx
set aspreserve
ontsconfig.json
.Also, is import some scripts configured on
package.json
for the developmen of the templates.With this setup, is even not necessary run
yarn emails:export
, each time the server hot reloads on development mode, the templates are updated ondist/emails/templates
.By end, i had to do 2 updates on your adapter implementation:
tmpl.default.default
totmpl.default