What do you mean by “an html email converted to an html file” ? Maybe if it’s slow, it’s due to the file weight, or something else.
Can’t you achieve that using AJAX call ?
i converted emails saved as rtf, into html with a CLI tool (don’t remember right now). and i got html pages maintaining the styles of the original email.
the email weights 4kb and the linked image 200kb, seems weird.
using $file->read() loads it instantly, though on the Timeline tab of the inspector, it still takes 4 seconds. but now the link to the image in the email is broken, i guess because i’m rendering it differently than through the iframe?
the image link is <img src="file.jpg">, and was working before.
EDIT
it’s just an incorrect url
EDIT 2
the only downside of using file->read() is that i need to manually adjust each url… but doable.
What is your use case? You can of course use $file->read() if you include it into a naked template i.e. without any header/footer code. But currently I don’t see the whole purpose of this…
If you make the email template a separate page, you can simply include it into an empty template using $file->read()- If you want to include it into another template, you will have to use an iframe. Normally, it shouldn’t take ages to load, wonder what takes so long. What does the timeline say takes so long?