-
Notifications
You must be signed in to change notification settings - Fork 8
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
Enhanced MJML Compilation and README Update #5
Conversation
Hello, I've been trying for hours to get my unit test to work, but with no success.
The idea is to compile two files present in the "with-php" folder to obtain the correct final structure. I tested locally without running the tests, and it works. So, I get a "blade.php" file that corresponds to the MJML structure, and another ".blade.php" file that corresponds to the TEXT structure of the same email. I hope I have been clear. Good evening, and sorry, I really struggle with JavaScript unit tests. |
Hey there @leknoppix, I'm trying to understand the final goal of the PR. The lengthy PR message doesn't really help me get it unfortunately. 😓 Is your intent to improve the support of (not) compiling "plain text" emails, that would happen to be in the same directory as your mjml templates? Could you please use a tool like https://tree.nathanfriend.io/ to show me the file structure you'd like to have before compilation, and the one you'd like to have after compilation? Thank you! |
Hello and thank you for your response. The idea behind my Pull Request (PR) is quite simple. Here is an example structure: In the end, this allows for preparing the text structure, just like for MJML files, without any HTML tags. The compilation process, for MJML files, involves compiling them (initial action of this module). If PHP files are detected, it simply involves copying and pasting them to the intended destination. |
Your link isn't working!
Is this required because the target directory is I'm not against adding the feature, but I would like to ensure there is no viable alternative before |
I've found an alternative approach that doesn't involve using your module. I'll be exploring it through the https://www.npmjs.com/package/vite-plugin-static-copy module. Thus, your module will only serve for the MJML to HTML conversion, and that's it. The vite-plugin-static-copy module will only be used for copying the plain versions.
If this works for you, please close my pull request, as it might be more logical to separate these two actions. |
I also think it's better to separate these functionalities, but in practice I haven't implemented plain and html emails at the same time so I'm not sure about the DX I'll close the PR for now, but if you feel there is too much friction with the additional I'm open to still adding the functionality in this plugin 👍 |
My solution works and it doesn't overload the build execution. |
I hope this message finds you well. Firstly, I want to express my gratitude for the fantastic work you've put into maintaining this package. It has been an invaluable tool for my projects.
I've made some enhancements to the MJML compilation process that I believe will be beneficial for the community. Specifically, I've added the option to skip the compilation of text versions in MJML, resulting in separate Blade files for both HTML and text versions after compilation.
Previously, with files like mjml/index.mjml for the HTML version and text/index.php for the text version, the compiled output would be mjml/index.blade.php for HTML and text/index.blade.php for text. This modification facilitates the inclusion of both versions in Laravel mail delivery, supporting multipart functionality.
In addition to this, I plan to push the corresponding unit test later this evening to ensure the robustness of the changes.
I've also made an adjustment to the README to document the new "exclude" option for users who may want to exclude specific files during the compilation process.
Thank you for considering this pull request. I'm looking forward to your feedback, and I'm happy to address any questions or concerns.
Best regards,