Smashing ebook #11 mastering wordpress advanced techniques 2011

Page 122

<?php /* Plugin Name: My Awesome Email Plugin Plugin URI: http://myawesomewebsite.com Description: I created this plugin to rule the world via awesome WordPress email goodness Version: 1.0 Author: Me Author URI: http://myself.me */ ?>

Once that’s done, save the file, go to the WordPress admin section, and activate your new plugin. If you’re new to this, then congratulations! You have just created your first working WordPress plugin! It doesn’t really do anything yet, but don’t let that bother you. Just read on, because we’ll be adding some functionality after the next section.

Creating An Email Template Creating good email templates is worth a chapter on its own. I will just share the method that I use, which does not mean that doing it differently is not allowed. Feel free to experiment! I am not a big fan of using images in emails, so we will be building an HTML template using only CSS. Our goal is to come up with a template to which we can add a header and footer section. We will send our emails in WordPress by pulling in the header, putting the email text under that and then pulling in the footer. This way, you can change the design of your emails very easily just by modifying the templates. Without further ado, here’s the code for the email template that I made. Or you can download it as an HTML file (right-click, and then select “Save as”). If you want a quick preview of what it looks like, just click the link. Smashing eBook #11│Mastering WordPress │ 122


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.