-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix: Dynamic Content in emails (legacy builder)- default content is not saved properly #11887
Conversation
Works as expected from user-perpective! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me 👍
Just app.js should not be part of the PR. It's regenerated during the release process.
I believe this fix is faulty for html content. We experienced a double escaping issue. Doing the following resolved this:
(i.e. using .text() instead of .html(). The way I understand the procedure here is that during init (when the initial html is build from the template) dynConContent isn't yet a froalaEditor - but it does have the ".editor" class. Insepcting the DOM revealed that the content from the database was inserted into the DOM as text, not html. I have the suspicion that this is the actual problem for the double escape and that my proposed fix just plasters over the cracks. |
@irfanhanfi thank you for this PR, there is a feedback, I think it is worth considering |
ea42def
to
23d46ab
Compare
I have addressed that change. |
@irfan-synerzip thanks a lot. Although I wonder if this breaks the grapejs stuff. Maybe the whole block should be: if (Mautic.getActiveBuilderName() === 'legacy') {
if (dynConContent.data('froala.editor')){
dynConContent = dynConContent.froalaEditor('html.get');
} else {
dynConContent = dynConContent.text();
}
} else {
dynConContent = dynConContent.html();
} |
1e1c2c9
to
b944636
Compare
@beschulz I did not see the issue with the GrapesJS editor but your approach looks safer. I have made the changes as per the latest comment. Thank you! |
…ot saved properly
b944636
to
4b21bf3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR and rebased it to 4.4, it looks goo to be merged
@allcontributors please add @irfanhanfi for code |
I've put up a pull request to add @irfanhanfi! 🎉 |
Description:
This PR is to fix the issue mentioned here - #11788