Your message has been sent.
This article has been saved to your account.
Go to my account
This article has been emailed to your Kindle.
Send this article
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.
|Read more about this book|
(For more resources on this subject, see here.)
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:
Under the Settings menu, click on the new PHPlist link to configure the plugin:
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.
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:
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:
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:
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:
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:
In this article, you've learned about integrating phpList with the popular publishing platform, WordPress.
- Integrating phpList 2 with Drupal [Article]
- phpList 2 E-mail Campaign Manager: Personalizing E-mail Body [Article]
- Tcl: Handling Email [Article]
- Email, Languages, and JFile with Joomla! [Article]
eBook Price: €18.99
Book Price: €30.99
About the Author :
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: