react-email-editor icon indicating copy to clipboard operation
react-email-editor copied to clipboard

I have my premade HTML template , i want to convert into json design , How can i do that ?

Open manthan-sf opened this issue 4 years ago • 26 comments

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 ?

manthan-sf avatar Jul 17 '20 16:07 manthan-sf

I also need this anyone?

ihiteshgupta avatar Jul 20 '20 15:07 ihiteshgupta

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);
     });

hazemKrimi avatar Aug 25 '20 03:08 hazemKrimi

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!

codingleo avatar Apr 27 '21 19:04 codingleo

Hi @codingleo I'm also looking for a solution for this problem. Please let me know if you have found one.

StebanDev avatar May 06 '21 05:05 StebanDev

You need to convert html to json manually @codingleo @StebanDev

hazemKrimi avatar May 07 '21 00:05 hazemKrimi

Any solutions yet?

Nanle21 avatar Jun 24 '21 20:06 Nanle21

I am also looking for something like this

ffjanhoeck avatar Jul 16 '21 08:07 ffjanhoeck

Any progress on this issue? Couldn't find anything on the docs.

alikuru avatar Jan 10 '22 12:01 alikuru

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.

gjphilander avatar Mar 15 '22 00:03 gjphilander

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

Mallesh-Nagothi avatar Mar 30 '22 03:03 Mallesh-Nagothi

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. converted

All the buttons you see in the menu are operational and doing what they are supposed to do. Please let me know your thoughts.

gjphilander avatar Mar 30 '22 14:03 gjphilander

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 avatar Mar 30 '22 14:03 gjphilander

@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 ...

charlesmudy avatar Mar 31 '22 11:03 charlesmudy

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..

gjphilander avatar Apr 01 '22 00:04 gjphilander

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

charlesmudy avatar Apr 01 '22 00:04 charlesmudy

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.

gjphilander avatar Apr 01 '22 06:04 gjphilander

Any update on this yet @gjphilander ?

charlesmudy avatar May 18 '22 08:05 charlesmudy

@charlesmudy I am suoer busy with it :)

gjphilander avatar May 19 '22 14:05 gjphilander

Please, I would like to know if you were able to deal with this issue, since I am currently having the same problem

william0795 avatar Nov 16 '22 15:11 william0795

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

harmoney-franck avatar Feb 13 '23 05:02 harmoney-franck

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

kaliljoao avatar Apr 05 '23 16:04 kaliljoao

Hey @gjphilander, any update on this part of the project? The editor is super useful, just this part is missing.

akash-badiyani avatar Jun 20 '23 14:06 akash-badiyani

Hey @gjphilander @alikuru @charlesmudy @codingleo @ffjanhoeck @Nanle21 any update for this issue? Really stuck with this part.

Anubhavgarg1910 avatar Apr 07 '24 08:04 Anubhavgarg1910