How to Integrate Aweber with WHMCS Billing for WordPress

Integrating Aweber email marketing and WHMCS for WordPress BillingThe WHMCS provisioning plugin makes it easy to integrate WordPress with the WHMCS billing software, a program which lets you use your website to sell hosting packages, domains, and other virtual products and services.

And if you’re a fanatic about email marketing, chances are your preferred list manager is Aweber; one of the most feature-packed systems available for maintaining contact with your customers and list subscribers.

Separately, these two programs feature some of the best integrations on the web, but developers have yet to add a custom solution to integrate the two programs themselves.

What follows is a tutorial on how to integrate your WHMCS billing software with Aweber email marketing. This custom integration will add all your new WordPress and WHMCS clients/users into your Aweber email lists without having to export a single record from either database.

Aweber WordPress Integration

One of the great things about using Aweber with WordPress is how well the two work together; and there is no shortage of Aweber plugins for WordPress:

  • There’s the Aweber Web Form for WordPress, which lets you add signup forms for your lists in a widget on your site.
  • One that captures new WordPress user registrations and sends that data to an Aweber list of your choice.
  • There’s even a free one-page theme from launcheffect that captures email from interested parties and uploads that to your Aweber accounts

Where Aweber Integration Falls Short

While all that Aweber integration is nice, it requires you to use the standard WordPress registration functionality, or a widget somewhere on your site. But that just captures emails of people interested in your newsletter who use that particular widget form, not new user registrations to your actual site.

WHMCS Muddies the Waters

WHMCS is a full-featured billing system for web providers, and it works particularly well for small hosting companies, web designers, and anyone running a multisite network who charges for a variety of products and services.

There’s an amazing plugin that integrates WHMCS billing with WordPress, and can automatically pair new user registrations (and their websites) and provision those sites for use in WordPress. WHMCS even comes with its own email templates that get sent to your new users and clients when certain triggers are met; like:

  • new user signup
  • new product purchase
  • new hosting account
  • renewal period alerts
  • and a whole bunch more

The only downside with WHMCS is that it creates another user account for your client separate from their WordPress login. The former is used to manage access to the billing system and handle domain and hosting issues, and the latter is used for editing the actual website.

So, while you’ve hooked in a great solution for billing your clients by using WHMCS you’ve also created another layer of complexity and added a step to the email signup process, making it even less likely your users will subscribe to your email list.

The WHMCS – Aweber Integration

The good news is that Aweber makes custom list integration possible using its Email Parser, which works with just about any application that can output an email address.

Basically, an email parser takes information contained within an email, parses out the data and slips it into an Aweber list. So to get WHMCS to work with Aweber’s, we’ll be making WHMCS send Aweber an email with customer/user info, which is stripped from the text of the message and inserted into proper fields in our email marketing list.

Using Aweber’s Email Parser and WHMCS’s custom templates we’ll integrate the two systems and show you how to make sure every one of your new site users and clients get hooked into your email marketing list automatically.

A Note on Permission Based Email Marketing

Everyone loathes spam, and most of us don’t like getting unsolicited emails either. This is important to note because the method we are using to add people to your mailing list does not require filling out an email signup form – everything is being processed when users sign up for a site on your network or an account through your WHMCS panel.

And even though Aweber sends a confirmation email to everyone who gets subscribed to your list, it may come as a surprise to some people who didn’t know they are being added to that list during your new site sign up process.

Therefore, it’s important to do one (or all) of the following things:

  1. Let people know they are subscribing to your list during the new site sign up process
  2. Remind them about your list in the welcome email before they get the Aweber confirmation notice
  3. Modify Aweber’s confirmation notice to remind the user why he or she is getting your email or being signed up for your list.

The more transparent you make the email marketing sign-up the more confirmed users you will have, and a higher click-through rate to go along with it.

WHMCS Template Emails

WHMCS includes several templates you can send to new users of your site – all of which are editable to your needs. It also gives you the ability to create your own templates for situations, services, and products that might not be covered by the standard ones included with the system.

The process we’re going to use can be worked into just about any email template on the list, but we’re going to focus on using one of the first emails in the sequence – the Client Signup Email.

Turning on the WHMCS Client Signup Email

If you are using WHMCS for billing or to configure client hosting or domain purchases chances are you’ve already setup a product or service. If not, you’ll need to do that before continuing on with this tutorial.

Of course, you could create all new clients manually inside the system yourself, and then send them the new client email template, but that defeats the purpose of using an automated system like WHMCS. I suggest reading the WHMCS documentation and getting your first product or service configured, and in doing do, selecting the Client Signup Email to be sent as the welcome email.

Setting Your System Email Address

Aweber needs to know the address from which your system emails will be coming, so we’ll need to set that in WHMCS. In the WHMCS admin panel for your domain, head over to “Setup” tab and click on “General Settings.”

The first tab is the “General” tab which look like this:

WHMCS - General Settings Panel Image
Sample WHMCS General Settings Panel. Click image to enlarge.

The second setting “Email Address” is the address from which your WHMCS system will be sending emails. Make sure to enter an address you use for your organization. I typically use something like [email protected] Make sure that email address is set up on your email server and is active before testing this integration.

Editing the WHMCS Client Signup Email for Aweber Parser

The Aweber parser needs one field to work properly: email address. As long as it receives this field from your WHMCS email you will successfully add your new user to Aweber. Your new client email may not include the email address of the new user, so we’ll need to add that information to the template email.

Inside your WHMCS admin panel, click on the top menu bar labeled “Setup” and then click on “Email Templates.”

You’ll be looking at a screen with all the standard WHMCS email templates. Some will be grayed out in color – meaning they are active, and others will be red in color – meaning they are not currently active. The first email template listed under General Messages should be the Client Signup Email. Click on that title.

WHMCS - Email Templates - New Client Signup Email
New Client Signup Email Template in WHMCS Settings Panel. Click image to enlarge.

Now you’ll be staring at a text editor with some stock user signup text. You can change this text to anything you want your new client to see after he or she signs up. In my email, I congratulate them for making a great choice in signing up on my site. I remind them where they signed up, and list for them the email address and username they chose at signup, and remind them of the login url they can visit to edit their billing preferences.

Essentially, the second half of my new client email it looks like this:

You can access your secure client area with the following login details:

Email: {$client_email}

Password: {$client_password}

Login URL: {$whmcs_url}

The WHMCS email template editor uses short codes to personalize the emails, and those short codes are provided for you via a drop-down selector near the editor.

Important here is the shortcode for the user’s email: {client_email}. It doesn’t matter whether you add spaces between the word “address” and the short code, but whatever you choose, make sure you copy it in a safe place because we’re going to be pasting that into Aweber shortly. I recommend copying to a text/code editor like Coda, and not into a processor like Word, because you may lose formatting in the transfer.

Once you’ve edited your template click the save button and give the new template a test. Create a new client and make sure it sends the proper template to the address used in the sign up. Wait a few minutes for that email template to arrive and confirm it sends the correct message.

Using the Aweber Email Parser

Once you’ve confirmed the new client email is working properly, you’ll log into your Aweber account and make sure to work with the proper list. You can change lists in the top left drop down box.

Choosing the correct Aweber Email marketing list

Remember, Aweber uses permission based lists and it will send a confirmation to your new user when the parser is working correctly. Make sure to remind the user why they might be getting this message and that they recently signed for an account on your site.

Now, head over to the “My Lists” tab and click on Email Parser. You’ll be taken to a long list of custom email integration parsers already setup to work with Aweber. Unfortunately, WHMCS is not one of them – hence the need for this tutorial.

Scroll down to the bottom where you’ll find “Custom Parsers.”  Click on the link to “add new” next to the custom parser title and you’ll see a screen like this:

Create a new Aweber Email Parser
Create a new Aweber Email Parser. Click image to enlarge.

Editing the Aweber Email Parser

You’ll notice Aweber has completed most of the heavy lifting for you, but there are a few settings you’ll need to change.

Description

Make this field something you’ll remember. I use “WHMCS New Client Aweber Integration.” Of course, you can be as specific as you like. For instance, if you were using WHMCS to send Aweber information on clients who sign up for hosting accounts but not new domains, you might use a descriptive title like “WHMCS Hosting Account Aweber Integration.”

The beauty of WHMCS is you can create a custom email for just about anything under the sun, and Aweber allows for unlimited list building too.

Trigger Rule

This is how the parser knows what to do with the email when it arrives from WHMCS.

Aweber custom email parser trigger rules.
Aweber custom email parser trigger rules. Click image to enlarge.

Make sure the “Match On” drop down box to the right has “Headers” selected.

In the Trigger rule box you’ll be exchanging the terms “user” and “@domain.com” for appropriate values.

For example, my WHMCS system uses the email address [email protected], (This is the email address we set in the earlier step about WHMCS general settings). So in Aweber, my trigger looks like this:

Aweber custom email parser trigger rules
Example of a filled-in Aweber custom email parser trigger rule. Click image to enlarge.

Basically, the trigger rule reads: From: [^n|.][email protected]

  • “user” was replaced with my leading email name “support”
  • “domain” was replaced with my domain name “orgspring”
  • “.com” was replaced with my top-level domain extension “.org”

Make sure to leave all slashes, plus symbols, @symbols, and other character encodings in place. They relate to how your computer system marks up the email character and line feeds. Those markings are different depending on whether your computer’s operating system is based in Windows, Linux, or Mac; but Aweber accounts for that with it’s formatting.

Decode HTML Entities

Make sure to turn this setting on as it will decode your WHMCS email if it’s sent out in HTML.

Rule 1 – Email Address

This is the last required setting we need to manage inside Aweber’s email parser. Out of the box, it is set to the following:

Edit email parser screen in Aweber
Regular expression editor in the Aweber Email Parser

You’ll notice there are two drop-down boxes here. One for “Match” and another for “Store In.”

Match tells Aweber where to look for the expression entered in the Rule 1 text box, and “store in” tells Aweber where to put the information it finds. Match has only two choices: headers or body. Store in will likely give you four choices:

  1. Email
  2. Name
  3. Ad Tracking
  4. Misc.

As mentioned before, Email is the only field required to make the parser work,  so make sure the “Store in” section is set to “Email.”

This is actually the last thing we’ll need to change, but I’ll run you through the regular expression coding so you understand what is going on. The stock rule you will be looking at inside the email parser looks like this.

Aweber Custom Email Parser Ignore leading Spaces Expression Code
Aweber Parser will ignore leading spaces. Click image to enlarge.

Do not edit this first part of code as shown inside the red box. If you have any text in your new client email before actually listing the new client’s email address it will be ignored. This is what we want to happen.

The next part of code inside the expression is looking for the word “Email” followed by a colon, like this “Email:”

Custom Aweber Parser edit expression for email
Aweber Parser looks for Email among your code. Click image to enlarge.

In this part of the expression, Aweber’s parser is looking for the first mention of the text “Email:” in your new client email. So here, we’ll want to use the text from our new client email. Remember, in WHMCS we set the new client email to display the following:

Email: {$client_email}

Password: {$client_password}

Login URL: {$whmcs_url}

Notice the space after the colon and before the short code in each line. This is important – every character counts.

You’ll also notice we set our user email to be introduced by the phrase “Email:” We did this on purpose because it matches what Aweber is already looking for in its parser. If you decided to change this text to something different, say “EmailAddress” or “Email Address Used” the code you use in the Aweber parser will have to change accordingly.

Again, in our case, we used “Email:” so we don’t actually need to change what you see in the red box in the image above.

The last part of the rule 1 expression looks like this:

Ignore trailing spaces in Aweber custom email parser
Regular expression ignores trailing white space. Click image to enlarge.

In our email, we are using Email: {$client_email}. When WHMCS fills in the shortcode and sends that actual email, when it arrives in the user’s mail reader it doesn’t show the short code anymore. It shows that user’s information. For instance, it might look something like this:

Email: [email protected]

The regular expression you see highlighted in the red box above tells Aweber to ignore anything that after “Email:”

So, to recap..

The regular expression is ignoring any white spaces or line feeds before it finds “Email:” and then once it finds that text string it is using the very next strong of text as the user email and storing it in the variable email. Then it is ignoring any whitespace or line breaks that come after the email address used.

Again, in our case it will ignore everything before “Email:” and grab the very next item – [email protected]; exactly what we want.

The Aweber parser then stores that email address in the Email field, which is the setting we chose for the “store in” drop down box.

Click Save and return to the Aweber parser list. You do not need to click the check box to “Enable parser for all lists in this account.”

Enabling Aweber’s Custom Parser

Once you return to the list of custom parsers you will be presented with a green flashing message that your parser has been saved. You’ll need to scroll back down to the bottom of the page to see the new parser in action.

It will have a check box to the left of the title and a red X to the right, along with a blue link to edit the parser.

Simply select the check box and the parser title will highlight in green. Aweber will remind you that you still need to configure the custom parser, but all that tutorial tells you is how to use the custom list email, which we explain below in terms much easier to understand.

Finishing the Aweber Parsing

That’s it; you’re done with the Aweber parsing. You can delete anything listed in Rule #2 or subsequent rules, you won’t need them.

But we’re not completely done with the integration yet. We still need to tell WHMCS where to send the new client email so that Aweber has something to parse. This is the easy part.

Aweber creates a unique email address for every list using the format [email protected] That’s why Aweber insists on you using list names that are unique because it gets a unique email address and cannot be replicated across Aweber’s entire system.

If your Aweber list name is WHMCSHOSTING, you’re Aweber unique email address will be [email protected] This list name will already be set if you’ve gotten to this point, and that will be displayed at the top right of your screen under the drop down box for “Current List.” Our list was called “orgspringnp” which means our unique email address for Aweber integration is [email protected]

Input the Aweber List Name in WHMCS

Armed with the unique Aweber email address for your own list (note: do not user [email protected]), you’ll return to WHMCS email template settings, and once again you’ll edit the custom template for new client email.

The second setting in the new client email asks for an email address to which the email should be copied. This is where we will enter the custom list name email supplied by Aweber. Save your changes.

The Final Test of WHMCS – Aweber Integration

Now you’re done – the integration is complete. But before you celebrate, it’s smart to test the system.

Create another client account in WHMCS. I recommend deleting the last test account you created and using that same information over again.

You should immediately receive the new client email, just like before. Nothing has really changed there. But now, the WHMCS system is also sending an email to Aweber behind the scenes.

In a few minutes, you should also receive the confirmation email from Aweber stating that your email address has been added to a new list. It will ask you to confirm your subscription by clicking a link.

If you get this email you have successfully integrated Aweber and WHMCS. Don’t worry if this email takes a few minutes to arrive. Sometimes WHMCS takes awhile to send the email copy, and sometimes Aweber takes a few minutes to parse it. I’ve noticed this email transaction can take as much as 20 to 30 minutes to conclude. Most times it happens instantly.

But if you don’t see that email within an hour or two something probably went wrong. Go back and check your settings. Every space counts. Every letter counts. Capitalization counts.

And if you’ve come up with new and interesting ways to use the Aweber custom parser leave us a note. We’d love to see it.

Tags ,

Participate