I am searching a way to send mail through PHP based on HTML template. But the user that will send the email must be able to preview it and edit it if needed.
So I began to use PHP Mailer to send the mail. It works very well. I also used TinyMCE to allow the user to preview the mail and edit it easily.
And I am a sort of blocked by this javascript library. There a lot of problem by sending html content to js (Parsing, carriage return, ...) The only way to get this working is to edit all my HTML templates... So it is definitly not a solution.
I also have to replace content of template.html by field stored in a database. It works too.
The main problem is passing a var containing all the HTML content to javascript ...
I have two ways to proceed:
$test = "<html><h1>Title</h1><body>MyBody</body></html"
to javascript without triggering a billion errors.The HTML templates are not so heavy but I have +- 50 of them. Is it a good solution to store them in a database ?