Integrating phpList 2 with WordPress

Exclusive offer: get 50% off this eBook here
phpList 2 E-mail Campaign Manager

phpList 2 E-mail Campaign Manager — Save 50%

Get to grips with the phpList e-mail announcement delivery system!

$23.99    $12.00
by David Young | July 2011 | Open Source Web Development

WordPress is an open source blog tool and publishing platform powered by PHP and MySQL. It's often customized into a Content Management System (CMS). It has many features including a plug-in architecture and a template system.

In this article by David Young, author of phpList 2 E-mail Campaign Manager, we're going to use the plug-in architecture and a template system of WordPress to add phpList integration.

 

PHPList 2 E-mail Campaign Manager

PHPList 2 E-mail Campaign Manager

Get to grips with the PHPList e-mail announcement delivery system!

        Read more about this book      

(For more resources on this subject, see here.)

Prerequisites

For this section, we'll make the following assumptions:

  • We already have a working instance of WordPress (version 3.x)
  • Our phpList site is accessible through HTTP / HTTPS from our WordPress site

Installing and configuring the phpList Integration plugin

Download the latest version of Jesse Heap's phpList Integration plugin from http://wordpress.org/extend/plugins/phplist-form-integration/, unpack it, and upload the contents to your wp-content/plugins/ directory in WordPress.

Activate the plugin from within your WordPress dashboard:

Integrating phpList 2 with WordPress

Under the Settings menu, click on the new PHPlist link to configure the plugin:

Integrating phpList 2 with WordPress

General Settings

Under the General Settings heading, enter the URL to your phpList installation, as well as an admin username/password combination. Enter the ID and name of at least one list that you want to allow your WordPress users to subscribe to:

Why does the plugin require my admin login and password?
The admin login and password are used to bypass the confirmation e-mail that would normally be sent to a subscriber. Effectively, the plugin "logs into" phpList as the administrator and then subscribes the user, bypassing confirmation.
If you don't want to bypass confirmation e-mails, then you don't need to enter your username and password.

Form Settings

The plugin will work with this section unmodified. However, let's imagine that we also want to capture the subscriber's name. We already have an attribute in phpList called first name, so change the first field label to First Name and the Text Field ID to first name (the same as our phpList attribute name):

Adding a phpList Integration page

The plugin will replace the HTML comment <!--phplist form--> with the generated phpList form.

Let's say we wanted our phpList form to show up at http://ourblog.com/signup.

Create a new WordPress page called Signup, add the content you want to be displayed, and then click on the HTML tab to edit the HTML source:

You will see the HTML source of your page displayed. Insert the text "<!--phplist form-->" where you want the form to be displayed and save the page:

HTML comments
The "<!--some text-->" syntax designates an HTML comment, which is not displayed when the HTML is processed by the browser / viewer. This means that you won't see your comment when you view your page in Visual mode.

Once the page has been updated, click on the View page link to display the page in WordPress:

Integrating phpList 2 with WordPress

The subscribe form will be inserted in the page at the location where you added the comment:

Adding a phpList Integration widget

Instead of a dedicated page to sign up new subscribers, you may want to use a sidebar widget instead, so that the subscription options can show up on multiple pages on your WordPress site.

To add the phpList integration widget, go to your WordPress site's Appearance option and go to the Widgets page:

Integrating phpList 2 with WordPress

Drag the PHPList Integration widget to your preferred widget location. (These vary depending on your theme):

You can change the Title of the widget before you click on Close to finish:

Integrating phpList 2 with WordPress

Now that you've added the PHPList Integration widget to the widget area, your sign up form will be displayed on all WordPress pages, which include that widget area:

Summary

In this article, you've learned about integrating phpList with the popular publishing platform, WordPress.


Further resources on this subject:


phpList 2 E-mail Campaign Manager Get to grips with the phpList e-mail announcement delivery system!
Published: July 2011
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:

About the Author :


David Young

David Young's first experience in documenting the open source world was the official 2003 manual for JAJC, a popular jabber client, which he authored in XML using Docbook.

He followed this with the development of "Bandersnatch", the whimsically named Jabber message logger, which remains the de facto open source platform for recording and archiving messages on a Jabber server.

After founding and successfully running an open source consulting company ("Funky Penguin") for several years, David "retired" to full-time employment.

David now works for a respected New Zealand IT consulting firm (Prophecy Networks Ltd) and pursues the odd "Funky Penguin" project in his spare time.

David's projects, notes, and ramblings can be found at:
http://www.funkypenguin.co.nz.

Books From Packt


WordPress 3 Plugin Development Essentials
WordPress 3 Plugin Development Essentials

WordPress 3 Complete
WordPress 3 Complete

WordPress 3 Ultimate Security
WordPress 3 Ultimate Security

High Availability MySQL Cookbook
High Availability MySQL Cookbook

Mastering phpMyAdmin 3.3.x for Effective MySQL Management
Mastering phpMyAdmin 3.3.x for Effective MySQL Management

PHP 5 E-commerce Development
PHP 5 E-commerce Development

Linux Email
Linux Email

Qmail Quickstarter: Install, Set Up and Run your own Email Server
Qmail Quickstarter: Install, Set Up and Run your own Email Server


Your rating: None Average: 5 (1 vote)

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
n
d
r
K
v
h
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software