Using WP to generate HTML emails .. where to keep files ?
-
Hi … I have this idea of generating the HTML for an email newsletter using WordPress. Idea is that I would have a simple plugin which implements a number of shortcodes, each of which will load a pre-generated HTML fragment from a file and piece them all together interspersed with text generated using the wordpress editor e.g.
[mc-header]
Dear Friends
This is my first newsletter
[mc-footer]I intend to have about a dozen different shortcodes to generate different parts of the newsletter using mainly canned HTML which is optionally slightly modified by the shortcode handler.
Viewing the page will then cause the email HTML to be generated and stored in a file which should be directly viewable by a browser.
So, a few questions
1) Does this make sense and am I moving in the right direction here ?
2) in the WP file system, I need to be able to read a number of HTML template files and then store a generated HTML email file. Where in the WP file system is the best place to do this reading and writing from (the plugin folder, theme folder or just off the wp root ?).
3) If say, I have a folder called email off my root wordpress folder (at the same level of wp-content etc), how do I reference an image in an ‘image’ sub-folder or html in an ‘html’ sub-folber using php ? And assuming that I have generated a composite email file in the same html directory, what is the URL of it so that I can view it with a browser.
Thanks
Ron
- The topic ‘Using WP to generate HTML emails .. where to keep files ?’ is closed to new replies.