Table of Contents

WordPress Newsletter Plugin Documentation (v2.x branch)

Requirements

  1. WordPress 2.0.x or higher (Tested on WP v2.0.7)
  2. WordPress 2.1.x or higher (Tested on WP v2.1.2)
  3. WordPress 2.5.x or higher (Tested on WP v2.5.0)

New Installation

If you are upgrading, please see the Upgrading section

  1. Extract the st_newsletter folder from the ShiftThis-WP-Newsletter.zip file.
  2. Upload the st_newsletter folder into the following WordPress directory: /wp-content/plugins/
  3. Access the Plugin Panel in your Admin Panel, scroll down through the list of Plugins to find ShiftThis | Newsletter and click on the Activate link to turn the Plugin on.
  4. Click on the new Newsletter Tab in your Admin Menu.
  5. You may need to set your Options on the Newsletter Options page before some features will be available to you.

Upgrading

If you are upgrading from a previous version:

  1. Extract the st_newsletter folder from the latest .zip file available on the My Paid Plugins Page
  2. Upload the st_newsletter folder into the following WordPress directory: /wp-content/plugins/ overwriting the previous files.
  3. Go to Newsletter > Options and check for any new features and set them to your preference, then save.
  4. You are now officially upgraded!

Newsletter Options

Access via the Newsletter Tab > Options.

Subscription Text

Access via Newsletter Tab > Subscription Text

Dynamic Tags

The subscription form text and emails can be customized from here. There are a number of Dynamic Tags available for use here.

You will also be able to your custom fields here as well. If you have a custom field named First Name, this can be used with the dynamic tag of {firstname}.

Text Fields

Subscription Form

Widgets

If you have the WordPress Widgets Plugin installed, you can use the included ShiftThis Subscribe Sidebar Widget to add the subscription form to your blog. Just access the Presentation Tab > Sidebar Widgets page and drag the ShiftThis Subscribe box from the Available Widgets into the Sidebar box. See the How to Use Widgets page for more information on Widgets.

Manual Procedure

Insert <?php stnl_subscribe(‘Subscribe’); ?> into your theme template in either your themes sidebar template or a page template to display the subscribe form. This form can be styled to your needs easily within your themes styles.css stylesheet. You can also use a PHP Plugin such as Exec-PHP to allow you to place <?php stnl_subscribe(‘Subscribe’); ?> within a page or post via the Write Panel. ‘Subscribe’ is the default button text. You can replace the ‘Subscribe’ text with anything you like.

Creating a Page Template

To create a page template that includes the Subscribe Form, you will need to be using a theme that includes the page.php file. If your theme does not include this file, you will need to create it (See WordPress Page templates).

  1. In your current themes folder, duplicate your page.php file and rename it subscribe.php
  2. Open subscribe.php and at the very top add the following code:
    <?php
    /*
    Template Name: Subscribe Form
    */
    ?>
  3. Now find the_content function, generally looks something like:
    <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
  4. Place the following code above or below this:
    <?php stnl_subscribe('Subscribe'); ?>
  5. Save the file and upload to your themes directory.
  6. Create or Edit the Page you want the form to appear on and under Page Template select Subscribe Form
  7. Save the page and make sure to set it in your Newsletter Options as well.

Newsletter Archive

To display your archive of published public newsletters, simply insert <?php stnl_archive(); ?> into a page template or your sidebar template.

Creating the Newsletter Template

This plugin uses custom template functions similar to WordPress’s own theme system. The basic template is available in the "/wp-content/plugins/st_newsletter/template/" folder. The names should be pretty self explanatory:

Below are the template tags and how to use them within the Template files:

The Post Template (st_post.php) uses regular Wordpress Template Tags to display your posts in the newsletter.

Create New Newsletter

Access via the Newsletter Tab > Create

You can also use your custom fields here as dynamic tags. If you have a custom field named First Name, this can be used with the dynamic tag of {firstname} inserted in the Content, Sidebar Boxes or Metabox.

Side Column:

Saving the Newsletter will not actually send anything. Sending is done within the Preview/Send Section.

Categories

Access via the Newsletter Tab > Categories.

Here you will have the default category of General listed. You can add, edit or delete a category here as well. Make sure you always have at least one category or no one will be able to subscribe.

Manage Newsletters

Access via the Newsletter Tab > Manage. Here you will have a list of all your created newsletters with the option to Edit or Delete individual Newsletters.

Preview/Send Newsletter

Access via the Newsletter Tab > Preview/Send Here you will have a list of all your created newsletters with the option to Preview/Send. This is where you can have a final look at your finished newsletter and then send it to your subscribers.

Click the SEND button under your option of choice to start sending. The time needed to send will vary depending on your server, the amount of subscribers and whether you use Swift Sendmail or SMTP.

Subscribers

Access via the Newsletter Tab > Subscribers. This will give you a list of all your current subscriber details and whether they are verified or not. You can delete a subscriber using the delete button next to there name, checking the box next to individual subscribers and clicking the Delete all checked button or by typing an email address into the Delete A Subscriber form.

You can now also manually add a Subscriber using the Add Subscriber area at the bottom of the page. This will add a subscriber as confirmed.

Import/Export Subscribers

Accessed via the Newsletter Tab > Import/Export

The Export Subscribers feature creates a CSV file for you to download. Just click the Export to CSV File (comma-seperated values) button and right-click the link that appears underneath and save the file.

The Import Subscribers feature allows you to import a CSV file of values you can map to the correct fields for use within the Newsletter Plugin. This will set all imported subscribers as verified. I recommend splitting your data into separate files of 100 to prevent server timeouts or connection errors.

Your CSV file needs to have each line terminated with a line break and each field separated with a comma(,). You should be able to open your CSV file in Notepad and view it without any strange characters showing up.

If your CSV file includes headings in the first row, make sure to select the option to ignore the first row in the next step.

Examples

This shows how the text should look within Notepad or other text viewer in your CSV file of import values.

Email Only Import
"fakeemail@mail.com"
"fakeemail2@mail.com"
"fakeemail3@mail.com"
"fakeemail4@mail.com"
"fakeemail5@mail.com"
"fakeemail6@mail.com"
"fakeemail7@mail.com"
"fakeemail8@mail.com"

Import/Export Requirements

To import the CSV file and read it’s contents, the plugin requires the following:

Import Instructions

  1. Click the Browse button and select your CSV file of values to import and click the Import File Button. This uploads the file to the server for reading.
  2. You should now have the Match Fields for Importing area visible.
    • Import First Row - Defaults to Yes, but if your CSV file contains Field Headings in the first row then select No.
    • Email - Select the Email value from the drop down.
    • Extras - Select the Extras value from the drop down
    • Categories - Select the Categories value from the drop down.
    • Continue for the rest of the values you may need. Leave unneeded fields as N/A.
  3. Click the Import Values button.

Your subscribers should now be imported. If you had any problems or errors while importing, make sure your CSV file is setup correctly, try using the included example files as a test.

Swift Test

Access via the Newsletter Tab > Swift Test.

This plugin is currently using Swift Mailer v3.0.5. Swift is a fully OOP Library for sending e-mails from PHP websites and applications. It does not rely on PHP‘s native mail() function which is known for using high server resources when sending multiple emails. Instead, Swift communicates directly with an SMTP server or a MTA binary to send mail quickly and efficiently.

Before releasing your Newsletter upon the world, it’s recommended to make sure that your Swift setup is working properly. Below you will find a number of simple test emails to run for your website. You will need to edit the file ‘st_newsletter/Swift/tests/TestConfiguration.php’ and fill with the appropriate values. This will eventually use your Newsletter Options settings. Try using the Swift Sendmail option first as it is the quickest and easiest way to send email. If your server does not support the Sendmail Option, use the SMTP option.

Localization (Language)

To localize your plugin to your own language, do the following:

Create A New Language File

PO Edit Windows

  1. Open your wp-config.php file from your WordPress Installation and change - define (‘WPLANG’, ''); - to define (‘WPLANG’, ‘en_CA’); where en is the language (en=English) and CA is the Country Code (CA=Canada) for your region. Save and upload back to your server.
  2. Run poEdit and open the st_newsletter/locale/WP-Newsletter.po file.
  3. To make changes to the text, select the line, then in the bottom-left box translate the text to your language. The top-left box is the original text, and the two right-side boxes are for comments only.
  4. Once you have made all the translation’s neccessary, choose File > Save As.. and name your file ‘stnl-en_CA’ except replace “en” with your language code, and “CA” with your Country Code that you set in step 1. Save the file in the same locale directory. (You may need to save twice to generate the .mo file needed).
  5. Upload the stnl-[language]_[COUNTRY].mo file to your server to finish the translation.