phpList 2 E-mail Campaign Manager: Personalizing E-mail Body

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

In this article by David Young, author of phpList 2 E-mail Campaign Manager, we will see how to use lists and attributes to personalize the e-mail we send to our subscribers. Personalizing e-mail messages makes them more engaging to readers and increases the effectiveness of your newsletters.

In this article, you'll learn to:

  • Enhance messages with built-in placeholders
  • Personalize messages using member attributes
  • Send messages to subsets of lists based on attributes
  • Use message templates for consistent layout and styling

 

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.)

Enhancing messages using built-in placeholders

For simple functionality's sake, we generally want our phpList messages to contain at least a small amount of customization. For example, even the default footer, which phpList attaches to messages, contains three placeholders, customizing each message for each recipient:

--
If you do not want to receive any more newsletters, [UNSUBSCRIBE]

To update your preferences and to unsubscribe, visit [PREFERENCES]

Forward a Message to Someone [FORWARD]

The placeholders [UNSUBSCRIBE],[PREFERENCES], and [FORWARD] will be replaced with unique URLs per subscriber, allowing any subscriber to immediately unsubscribe, adjust their preferences, or forward a message to a friend simply by clicking on a link.

There's a complete list of available placeholders documented on phpList's wiki page at http://docs.phplist.com/Placeholders. Here are some of the most frequently used ones:

  • [CONTENT]: Use this while creating standard message templates. You can design a styled template which is re-used for every mailing and the [CONTENT] placeholder will be replaced with the unique content for that particular message.
  • [EMAIL]: This is replaced by the user's e-mail address. It can be very helpful in the footer of an e-mail, so that subscribers know which e-mail address they used to sign up for list subscription.
  • [LISTS]: The lists to which a member is subscribed. Having this information attached to system confirmation messages makes it easy for subscribers to manage their own subscriptions. Note that this placeholder is only applicable in system messages and not in general list messages.
  • [UNSUBSCRIBEURL]: Almost certainly, you'll want to include some sort of "click here to unsubscribe" link on your messages, either as a pre-requisite for sending bulk mail (perhaps imposed by your ISP) or to avoid users inadvertently reporting you for spamming.
  • [UNSUBSCRIBE]: This placeholder generates the entire hyperlink for you (including the link text, "unsubscribe"), whereas the [UNSUBSCRIBEURL] placeholder simply generates the URL. You would use the URL only if you wanted to link an image to the unsubscription page, as opposed to a simple link, or if you wanted the HTML link text to be something other than "unsubscribe".
  • [USERTRACK]: This inserts an invisible tracker image into HTML messages, helping you to measure the effectiveness of your newsletter.

You might combine several of these placeholders to add a standard signature to your messages, as follows:

--
You ([EMAIL]) are receiving this message because you subscribed to
one or more of our mailing lists.

We only send messages to subscribers who have requested and
confirmed their subscription (double-opt-in). You can adjust
your list membership at any time by clicking on [PREFERENCES]
or unsubscribe altogether by clicking on [UNSUBSCRIBE].
--

Placeholders in confirmation messages

Some placeholders (such as [LISTS]) are only applicable in confirmation messages (that is, "thank you for subscribing to the following lists..."). These placeholders allow you to customize the following:

  • Request to confirm: Sent initially to users when they subscribe, confirming their e-mail address and subscription request
  • Confirmation of subscription: Sent to users to confirm that they've been successfully added to the requested lists (after they've confirmed their e-mail address)
  • Confirmation of preferences update: Sent to users to confirm their updates when they change their list subscriptions/preferences themselves
  • Confirmation of unsubscription: Sent to users after they've unsubscribed to confirm that their e-mail address will no longer receive messages from phpList

Personalizing messages using member attributes

Apart from the built-in placeholders, you can also use any member attributes to further personalize your messages. Say you captured the following attributes from your new members:

  • First Name
  • Last Name
  • Hometown
  • Favorite Food

You could craft a personalized message as follows:

Dear [FIRST NAME],

Hello from your friends at the Funky Town Restaurant. We hope the
[LAST NAME] family is well in the friendly town of [HOMETOWN].

If you're ever in the mood for a fresh [FAVORITE FOOD], please
drop in - we'd be happy to have you!
...

This would appear to different subscribers as:

Dear Bart,

Hello from your friends at the Funky Town Restaurant. We hope the
Simpson family is well in the friendly town of Springfield.

If you're ever in the mood for a fresh pizza, please drop in - we'd
be happy to have you!
...

Or:

Dear Clark,
Hello from your friends at the Funky Town Restaurant. We hope the
Kent family is well in the friendly town of Smallville.

If you're ever in the mood for a fresh Krypto-Burger, please drop
in - we'd be happy to have you!
...

If a user doesn't have an attribute for a particular placeholder, it will be replaced with a blank space. For example, if user "Mary" hadn't entered any attributes, her message would look like:

Dear,

Hello from your friends at the Funky Town Restaurant. We hope the
family is well in the friendly town of .

If you're ever in the mood for a fresh , please drop in - we'd be
happy to have you!
...

If the attributes on your subscription form are optional, try to structure your content in such a way that a blank placeholder substitution won't ruin the text. For example, the following text will look awkward with blank substitutions:

Your name is [FIRST NAME], your favorite food is [FAVORITE FOOD],
and your last name is [LAST NAME]

Whereas the following text would at least "degrade gracefully":

Your name: [FIRST NAME]
Your favorite food: [FAVORITE FOOD]
Your last name [LAST NAME]

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:
        Read more about this book      

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

Sending messages to subsets of lists based on attributes

The techniques we've discussed so far apply to messages sent to all the members of a particular list. You can also use user attributes to define a target subset of members to which a particular message should be sent.

Let's say you wanted to e-mail only members who lived in Albania, whose favorite food is pizza. When composing your message, click on the Criteria tab to add criteria based on attributes. Select the applicable attributes and remember to check the Use this one checkboxes where applicable:

After clicking on Save Changes, you can proceed to compose and send the message as you normally would. It will only be sent to users whose criteria match your selections.

Note that criteria-based selections don't work with plain text attributes, as the members' attributes can't be matched against previously known values. Only select, radio, or checkbox attributes are available.

Increasing the amount of criteria available

By default, phpList only allows you two selection criteria when sending messages based on user attributes. To increase the amount of criteria available, you'll need to edit config/config.php.

On line #296 in config/config.php, change the 2 in the line below to the maximum amount of criteria you need:

define ("NUMCRITERIAS",2);

Let's assume you want a maximum of 5 criteria available for selection (you don't have to use them all). Change the NUMCRITERIAS variable as follows:

define ("NUMCRITERIAS",5);

Now while selecting criteria when composing a message, there are five criteria available for use:

Using message templates

So far, we've used placeholders and attributes to customize individual messages. phpList also allows us to create message templates, so that all the repetitive parts of a message (styling, footer, and so on) can remain consistent and "out of the way".

Creating a message template

To create or manage message templates, click on the templates link on the right-hand navigation panel:

You are taken to the phplist - templates in the system page. All the templates you've defined will be listed here. Click on add new template to create a new template:

Either upload a pre-existing HTML file to use as a template or compose one using the WYSIWYG editor. Remember to insert the placeholder [CONTENT] where you want the dynamic content to be inserted when the message is sent:

Below the message compose window, above the Save Changes button, are options controlling the checking of external links and URLs:

If you reference local images in your template, phpList will prompt you to upload these; in that case, they will be attached to each message upon sending.

Click on Save Changes to save your template. In this example, phpList acknowledges that there are no local images referenced in the template. Click on send a message to compose a new message using this template:

Compose your message (just the dynamic content), save at least once, and then click on the Format tab to select a template:

Select your template and then continue to send the message as normal:

The content you entered replaces the [CONTENT] placeholder in the template:

Summary

In this article, you've learned to use built-in placeholders and user attributes to personalize the e-mails you send to your subscribers. You've learned about using built-in placeholders and custom attributes, selecting criteria when sending messages, and taking advantage of templates to provide a consistent look to your messages.

In this article, we have covered:

  • Enhancing messages with built-in placeholders
  • Personalizing messages using member attributes
  • Sending messages to subsets of lists based on attributes
  • Using message templates for consistent layout and styling

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


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

Agile Web Application Development with Yii1.1 and PHP5
Agile Web Application Development with Yii1.1 and PHP5

BlackBerry Enterprise Server 5 Implementation Guide
BlackBerry Enterprise Server 5 Implementation Guide

High Availability MySQL Cookbook
High Availability MySQL Cookbook

IBM Lotus Notes 8.5 User Guide
IBM Lotus Notes 8.5 User Guide

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


No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
x
c
t
i
T
4
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