Open connecteev opened 4 years ago
Well the relative path will be relative to the output file, so if you compile your index.mjml then it should be ./partials/sponsor_image.jpg
Absolute path should work fines in this case yep. Maybe we could add an option to alter src path to add the partials path to any relative src
that shouldn't be that hard to do 🤔
@iRyusa that would be helpful if the images need to be served locally. As you can see, right now, I can't do that and am forced to host the images externally.
Thanks for this project, I love MJML...but I'm struggling with this. I am using the MJML app andhave 2 emails in this example: index.mjml, userAccountCreated.mjml In both emails, I want to show header, footer. I want a "sponsor" section to be included from within footer.mjml. The sponsor section should show a local image, sponsor_image.jpg
This is my directory structure:
footer.mjml contains something like this:
and sponsor.mjml:
This works fine (image shows up) if I preview footer.mjml from the partials directory, but not if I preview index.mjml, userAccountCreated.mjml, in which case the image path does not work.
Are absolute image paths supported? What's the right way to do this? I have to make sure that sponsor.mjml is nested inside footer.mjml.