zalify / easy-email-editor

Easy Email Editor is a feature-rich, top open-source SaaS email editor based on React and MJML.
https://email.maocanhua.cn/
MIT License
1.59k stars 329 forks source link

How to manually assign variables? #276

Closed sambegin closed 1 year ago

sambegin commented 1 year ago

Hello again 👋

Quick question regarding the editor. I would like to use liquidJS engine to assign variables behind the scene, but it seems the conversion between the WYSIWYG (or JSON) editor and MJML is adding escape char (' ) instead of the real value. Unfortunately, it breaks the engine behind the scene as you can see in my screenshot.

Is there a way we can bypass this or this would require a fix in the code generating the mjml?

Screenshot 2023-03-23 at 10 58 07 AM Screenshot 2023-03-23 at 10 58 43 AM Screenshot 2023-03-23 at 10 59 38 AM Screenshot 2023-03-23 at 11 08 27 AM

Let me know your thoughts!

Thank you!

sambegin commented 1 year ago

Ok I might have found the reason why it is not working out of the box. This would maybe come down to the lodash's unescape function that does not handle more than a couple of unescaped char:

Screenshot 2023-03-23 at 11 50 52 AM Screenshot 2023-03-23 at 11 51 16 AM

🤔

sambegin commented 1 year ago

PR attempt to fix this: https://github.com/zalify/easy-email/pull/277

m-Ryan commented 1 year ago

It has been published to the latest version. Please check

sambegin commented 1 year ago

Thanks for the quick response! Closing this issue ✅