I work for a publishing house, where our editors create a HTML email newsletter from template. This was fraught with issues, as they would constantly modify the template code by accident as opposed to just adding content in to the right place(s), giving me headaches when it came to sending an Outlook-compatible newsletter.
I decided to write a form, which pulls in the editor’s content from numerous inputs, without them ever needing to see/touch the template source code. This is complete, however I would like a way for the editor to be able save/download the rendered HTML source code with the simple click of a button, as opposed to View Source Code > Select All > Copy and Paste in to new blank .txt document > Save and Send as e-mail attachment. Is there a PHP function with this (or similar) functionality?
It’s doable without any
fopenorfile_get_contentshacks. Use PHP’s output buffering and then callob_get_contentsand then save that to a file.