If you’ve done any work at all on WordPress themes, MailPress themes will be very comfortable.  MailPress adds a few extra things, but most – if not all – of the WordPress API is available from within a MailPress theme.  Andre has some rules for developing themes which you may want to read in addition to the information here.  Go to his mailpress site and then click on Design (too bad I can’t link directly there) to view it.  Here are some key rules:

  • No spaces in theme folder names.
  • CSS and javascript are not supported (bummer!).

MailPress themes reside under the plugins\mailpress\mp-content\themes directory – look familiar?  Themes consist of four different sets of files.

Required Files

  • style.css
    As in a WordPress theme, this file contains information about the theme, including its name, a description, tag information, etc.  Nothing else in this file is used since you can’t use CSS in MailPress themes.
  • index.php
    Doesn’t do anything at all and must be empty.  Not sure why it exists.
  • screenshot.jpg
    Displayed on the MailPress theme admin page.  If you design your own theme, please don’t just steal a screenshot from another theme.  Create one that looks your new theme.

General-Purpose Files (Optional)

None of these files are required, but they improve maintainability and consistency by reducing redundancy (say that 10 times fast).

  • function.php
    Contains common definitions that can be used by all templates.
  • header.php
    Contains code for common header content.  Template files can include this by specifying the following statement:
    <?php $this->get_header(); ?>
  • footer.php
    Contains code for common footer content.  Template files can include this by specifying the following statement:
    <?php $this->get_footer(); ?>
  • sidebar.php
    Contains code for common sidebar content.  Template files can include this by specifying the following statement:
    <?php $this->get_sidebar(); ?>
    Note that the standard functions for widgets used in WordPress cannot be used here since CSS can’t be used.

MailPress Templates (Optional)

These template files correspond to different types of subscriptions to your site.

  • new_subscriber.php
    Sent to a new subscriber after they have registered.  The email will contain a link the user can click to confirm their subscription.
  • confirmed.php
    Sent to a new subscriber after they have confirmed their subscription.
  • single.php
    Sent to subscribers each time a post is published.
  • daily.php
    Sent to subscribers containing a recap of the previous day’s posts.  The maximum number of posts included in the email is specified on the General Settings page.
  • weekly.php
    Sent to subscribers containing a recap of the previous week’s posts.  The maximum number of posts included in the email is specified on the General Settings page.
  • monthly.php
    Sent to subscribers containing a recap of the previous month’s posts.  The maximum number of posts included in the email is specified on the General Settings page.
  • comments.php
    Sent to subscribers each time a comment is approved/posted.
  • daily-cat.php, weekly-cat.php, monthly-cat.php
    Sent to subscribers based on categories.  Information on this feature is needed from Andre.

MailPress Templates for wp_mail

These templates are replacements for templates built-in to WordPress.

  • moderate.php
    Sent to the moderator of the site when a new comment is awaiting approval.  Also sent to a post author when a new comment, trackback, or pingback is posted.
  • new_user.php
    Sent to the site admin when a new user registers.  Also sent to the new user with their username and password.

Resources