react-email-editor
react-email-editor copied to clipboard
I have my premade HTML template , i want to convert into json design , How can i do that ?
I have my premade HTML template , i want to convert into json design as unlayer does , how can i convert my html to JSON design compatible to unlayer ?
I also need this anyone?
When you call the exportHTML method you can deconstruct the design JSON with the html from the data paramater provided by the callback function. Here is an example:
emailEditorRef.current.exportHtml(data => {
const { html, design } = data;
console.log('exportHtml', html, design);
});
Also interested on this subject. @hazemKrimi yeah, it's documented. But what abou the inverse?
Converting html
into json
data that could be used by the library.
I'll give this a 2 days for an answer, otherwise I'll try to work on a solution/workaround and let you know.
Thanks!
Hi @codingleo I'm also looking for a solution for this problem. Please let me know if you have found one.
You need to convert html to json manually @codingleo @StebanDev
Any solutions yet?
I am also looking for something like this
Any progress on this issue? Couldn't find anything on the docs.
I decided to tackle this issue and made good progress so far. My script can already convert 50% of unlayer html templates to unlayer json and I can successfully load it in the editor. Will see if I'm successful. I would guess that my script would at least convert the html 90%, but 100% is not improbable. As soon as I finish this project, I would like to convert any html template to unlayer.
I decided to tackle this issue and made good progress so far. My script can already convert 50% of unlayer html templates to unlayer json and I can successfully load it in the editor. Will see if I'm successful. I would guess that my script would at least convert the html 90%, but 100% is not improbable. As soon as I finish this project, I would like to convert any html template to unlayer.
Fantastic!! I'm also looking for this
I have now incorporated the script into the demo version of Unlayer. I have it online, but am not sure if i should post the link here.
I am attaching a screen grab of an imported Unlayer template. I would say that the script can do the job approximately 80% now. Some templates are imported 100%, but I suppose it all comes down to the complexity of the template.
All the buttons you see in the menu are operational and doing what they are supposed to do. Please let me know your thoughts.
Oh, I almost forgot!! I am working on a module to import the downloaded zip files of the Unlayer templates for conversion :) Chat soon.
@gjphilander are you push this live to test ? Good stuff ... Really need this badly.
Came across this https://github.com/barakaally/unLayer2be but not working well ...
you can test mine here: https://oneclickmobi.com/email-editor/#/ Just click on Import Unlayer Html button. From there you will know what to do..
Super solid start @gjphilander ... great work! Do you want to open this so the community can support and perfect this or whats your plan? I notice it doesn't really work with with external html files ... just sample templates from unlayer
Super solid start @gjphilander ... great work! Do you want to open this so the community can support and perfect this or whats your plan? I notice it doesn't really work with with external html files ... just sample templates from unlayer
Thank you @charlesmudy .
I would like to perfect it myself. It was a steep learning curve, but now that I have a better understanding of how it actually works, I am going to rewrite the library from scratch based on my findings. The reason why I do not want to open this specific library to the public, is because it can be utilized to scrape Unlayer's premium templates as well and that would not be in their best interest.
QUOTE: just sample templates from unlayer<--- Yes, that's correct. It is/was the best way to start, otherwise I wouldn't have a clue as where to start :)
I will most probably open source the new library with which one will be able to convert other html templates to Unlayer project files.
Any update on this yet @gjphilander ?
@charlesmudy I am suoer busy with it :)
Please, I would like to know if you were able to deal with this issue, since I am currently having the same problem
Hey @gjphilander, any update on your project? I have a tonnes of templates I'd like to migrate to unlayer and that would be super useful, thanks
you can test mine here: https://oneclickmobi.com/email-editor/#/ Just click on Import Unlayer Html button. From there you will know what to do..
can you explain the code? I trying to do the same but using vue.js
Hey @gjphilander, any update on this part of the project? The editor is super useful, just this part is missing.
Hey @gjphilander @alikuru @charlesmudy @codingleo @ffjanhoeck @Nanle21 any update for this issue? Really stuck with this part.