Integrating phpList 2 with Drupal

2 min read

PHPList 2 E-mail Campaign Manager

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

Prerequisites

For this article, we’ll make the following assumptions:

  • We already have a working instance of Drupal (version 6).
  • We are hosting our Drupal site and our phpList site on the same web server and with the same URL base. That is, our Drupal site is accessible at http://yoursite.com and our phpList installation is accessible at http://yoursite.com/lists/.

We chose to document the Drupal-phpList integration using Drupal 6, even though Drupal 7 has recently been released. This is because (a) the phpList module for Drupal 7 is still marked as “development” and (b) Drupal 6 has been the official stable version for three years and has a more familiar interface than 7 at this time.
However, the following method described for Drupal 6 will work on Drupal 7.

Installing and configuring the phpList integration module

Go to http://drupal.org/project/phplist and download the latest stable version of the module for Drupal 6.x. Unpack the tar.gz file and you should have a folder called phplist inside. Upload this folder to your Drupal installation’s modules directory and then navigate to Administer | Site building | Modules:

At the bottom of the modules list, you’ll find the Mail and phpList headings with a single phpList module under each. Check both and click on Save configuration:

External phpList configuration

Navigate to Administer | Site configuration | PHPlist to set up the database credentials and other options required for the integration:

You are prompted for your phpList database details. Enter your database host, database name, username, and password. Unless you’ve done a non-standard installation of phpList, the default entries for prefix and user table prefix will already be correct.

Under PHPList URL, enter the URL to your phpList installation. Because we are using phpList and Drupal at the same base URL, we set /lists/ (with a trailing slash) as our PHPList URL:

The database check illustrated in the preceding screenshot (red text reading Password is not set) is done after you save your settings. The module tries to connect to the phpList database using the details provided and will warn you if it fails.

Scroll to the bottom, ignoring the other options for now, and click on Save configuration:

If the database connection test was successful, the External PHPList configuration options will be collapsed into a single, clickable field, hiding them from normal view, as you configure the remaining options:

Attribute mapping

The module can auto-create attributes in phpList to match any attributes created in your Drupal instance. For example, you may ask your Drupal members to enter demographic information when registering and this mapping would allow these details to be transferred to the phpList.

Note that the module warns you that this mapping only works well with textline attributes and not select attributes or radio buttons. Use of this feature is not covered in this article, as it requires advanced pre-configuration of your Drupal instance:

Packt

Share
Published by
Packt

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago