Closed simllll closed 5 years ago
What else would you be rendering besides text/html/subject?
Let me know!
In my case I use it for deeplinks for example.
Regards
Can you share a snippet/example? I'm not sure what you're referring to for deeplinks. I only know that Nodemailer supports html
, text
, and subject
.
I use only the render part of the library, and I use it for all type of notifications. Besides email this is apn, fcm, webpush, redis pubsub,.. E.g. the render part looks currently something like this:
const rendered = await template.renderAll(contentType, data);
if (contentType === 'push') {
rendered.deeplink = await template.checkAndRender('deeplink', contentType, data);
}
return rendered;
Regards
I think that may be out of the scope of this library, since we use consolidate
internally, it may be easier for you to directly use it.
Ref: https://github.com/tj/consolidate.js
PR is welcome though
I was expecting that renderAll will render all files in one directory, but instead it's hardcoded to text,html and subject. Just in case someone else runs into this too ;) Would be great to add this to the documentation, or even better if there would be an option to add some custom templates.
Regards Simon