Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<mj-include> doesn't work because of relative paths #141

Open
tennox opened this issue Oct 10, 2022 · 2 comments
Open

<mj-include> doesn't work because of relative paths #141

tennox opened this issue Oct 10, 2022 · 2 comments

Comments

@tennox
Copy link
Contributor

tennox commented Oct 10, 2022

I can't use relative includes

<mj-include path="./_template.mjml" />

the MJML command is run on the file

/app/storage/framework/views/96c..817.mjml.php

but the includes are in relative to the view file in

/app/resources/views/emails/view-name.blade.php

(side question: Is there a better option than using .blade.php as extension? .mjml.blade.php did not work)

@tennox
Copy link
Contributor Author

tennox commented Oct 10, 2022

Could be easily 'worked around' with #142

But I would suggest adding --config.filePath= option automatically to make it work out of the box.

I have provided a PR for this: #143

tennox added a commit to tennox/laravel-mjml that referenced this issue Oct 10, 2022
This enables usage of <mj-include> with paths relative to the view file
asahasrabuddhe added a commit that referenced this issue Dec 27, 2022
#141 set config.filePath to view location
@maximepvrt
Copy link
Contributor

@asahasrabuddhe you can close this merge request ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants