Closed BenjaminDish closed 5 years ago
I think this is related https://github.com/niftylettuce/email-templates/issues/298#issuecomment-385241419 - maybe you have to have full path to the file from root of the project? That doesn't make sense - seems like we have a bug somehow either in consolidate
or in email-templates
. Maybe you can help discover it for us all 👍? You can also run with DEBUG=* node app.js
flag or DEBUG=email-templates node app.js
for more debugging output. Also see https://github.com/niftylettuce/email-templates/issues/225#issuecomment-300814108 for another approach that was suggested probably due to this same bug.
Hello, actually I guess it is more due to ejs. I tried doing the exact same thing using pug and pug "extends" worked perfectly using a relative path to the rendered template file.
Maybe we met a limit of what ejs can do ?
Concerning debugging, I would be glad to help but I don't even know what we should consider as a bug because I don't know the expected behavior. The docs doesn't specify if naming the templates "feature-folder/html.{ext}" is mandatory or could be changed. I also don't know if it is supposed to be possible to refer to "../" folder in the ejs docs.
Nevertheless, I chose to run with pug finally which seems to be simpler, more powerful and actually works
Hi, i have the same situation and here's how i solve it
app.js
- emails
- new-question
- html.ejs
- subject.ejs
- views
- header.ejs
- footer.ejs
and on the html.ejs of new-question
<% include ../views/header.ejs %>
CONTENT
<% include ../views/footer.ejs %>
Is there any way to send (pdf, xlsx ) files through the ejs templates. send through mails
<%- include('file path'); -%>
It worked for me when I added the '-' at the end
@c831216 I am using ejs3.x and email-template module doesn't render include, it only render the content.
<head>
<%- include('../partials/head') -%>
</head>
This is my ejs template and I get [object Promise]
instead of rendered text.
Hello,
I am trying to use this project with ejs. I have a lot of pain to understand how the rendering system works and how the template files coulds / should be structured and chained.
In my case, I can't maket it work without having one folder by template, containing a html.ejs file. Is it normal and mandatory or can we specify a filePath ?
Here is my app structure :
I want to render the notification-note template, which contains :
Here is the way I'm calling it :
I run into this error :
Could not find the include file "../top-wrapper"
I can't figure out how to make this work. Did someone already do this ?