Email Marketing Win

I just wrapped up online registration for the Mac-A-Thon which is a fundraising race for Keoua Canoe Club. This race has been going on for the past 32 years, and is one of the oldest 5k/10k runs on the island.

Three years ago when I joined the canoe club I volunteered to help with the web site. This eventually extended to helping with registration and marketing of the Mac-A-Thon. In 2011 I designed a new flyer, re-did the registration forms to include a line for an email address, and in 2012 I setup online race registration. That year, I imported all of the email addresses from our 2011 registration forms and sent out an email notice about the online registration option. We pre-registered about half of the runners online in 2012, which I took as a great step forward.

This year, I started our email marketing campaign earlier and sent more emails letting people know about our pre-registration savings deadlines. The result was a 100% increase in online registrations in 2013, which in turn makes this year one of the biggest Mac-A-Thon’s we’ve had in years.

All this with no budget, in my free time. Winning!

A huge shout out to MailChimp for making it possible.

Changing the default WordPress email sender

It’s not uncommon to want to change the email sender that WordPress sets automatically, especially in e-commerce situations. It’s actually really easy to do by adding a couple of filters in your theme’s functions.php file:

/** change the default WordPress email sender */
add_filter('wp_mail_from', 'my_mail_from');
add_filter('wp_mail_from_name', 'my_mail_from_name');

function my_mail_from($email) {
return 'customerservice@example.com';
}
function my_mail_from_name($name) {
return 'Customer Service';
}

Elavon Gateway Requires ‘ssl_customer_code’ for American Express

After building an Elavon gateway for Shopp, one of my clients reported an error saying that they were getting an error whenever one of their customers tried to pay with an American Express card. The error code was 4009 – Required Field Not Supplied, and the required field was “ssl_customer_code” which according to the developer guide is not required.

Elavon ssl_customer_code is NOT required
‘ssl_customer_code’ is NOT required… Or is it?

I’d email Elavon to let them know about the problem, but I’ve never gotten an email response from their tech support (even after talking to one of their support staff on the phone, who asked me to email him directly).

The easiest fix is to include ssl_customer_code on all transactions, even though it’s only used in  American Express transactions and (maybe?) recurring billing transactions. I hope this helps someone.

Filtering excerpts in WordPress

By default WordPress displays […] at the end of an excerpt, which doesn’t look good. Instead, I use this functions on blogs that I build, which changes it to something that looks better. Just add the following to your active theme’s functions.php:

function new_excerpt_more( $more ) {
return '... <a class="moretag" href="'. get_permalink($post-&gt;ID) . '"> Read More »</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

Upgrading Shopp 1.1.9 to 1.2.3

Shopp 1.2 has been with us for some time now, but prior to 1.2.2 there were problems with upgrading from 1.1.x. Now though, upgrading to 1.2.3 (the current version as of August 2012) from 1.1.9 is incredibly simple. Before proceeding, I recommend reading the documentation for upgrading to Shopp 1.2 and the template changes in 1.2.

The best way to proceed with an upgrade like this is to create a new sub-domain on your server where you can try the upgrade without making changes to your live site. Copy your site files to the new sub-domain, and copy the WordPress database to a new database. Once that’s done, you’ll need to update wp_config.php on the new domain to point to the new database, and also update the ‘siteurl’ line in wp_options to point to the new sub-domain. Once that’s done, you can proceed.

Backup Your Database

This is essential before doing any upgrade in WordPress, but many of us omit this step. I’ll admit, I’m guilty of this from time to time as well. We sort of expect that when we upgrade, everything will work fine, and backing up can be a pain. There are a number of plugins that will back up your database for you, but I prefer to go into phpMyAdmin to export the whole database. Once that’s done, we can move on.

Backup Your Files

You shouldn’t need to backup the entire site, as we’ll only be upgrading the Shopp folder, so you can get along just fine by downloading a copy of your wp-content folder. If you haven’t got a backup copy of your entire site in some time, this is a good time to do so.

Note Your Settings and Addons

When you upgrade Shopp, most of your settings are carried over properly. However, in the event that they’re not, it’s a good idea to have a copy of your settings on paper just in case. Go through the Settings page and make notes of your settings and set that aside. Also, if you use shipping or payment addons, make notes of your settings there as well. I discovered that when I upgraded to 1.2.3, Authorize.net forgot which credit cards it had been set to accept.

Get Fresh Downloads

Go to your Shopp account page and download the latest copy of Shopp core, and any addons that you’ll be using on the site.

Now, you’re ready to proceed with the upgrade. Cross your fingers, and here we go.

Maintenance Mode

If you *have* to upgrade on your live site (I mentioned that this is a bad idea, right?) then find a maintenance mode plugin and enable it before proceeding. This way, visitors to your site won’t get unfriendly error messages while upgrading.

Update Shopp Folder

Disable the Shopp plugin from within WordPress. I like to preserve the old Shopp folder, so move it to the parent folder (wp-content), then upload the new Shopp files. Once it’s done, upload the shipping any payment addons to the appropriate folders. When that’s all done, enable the Shopp plugin again.

Update Menus

One of the biggest changes in 1.2 is that Shopp no longer requires Pages to work. It uses “virtual” pages which are loaded from the new template files, and the page slugs are set from within the Shopp settings. Any menu references to the old Shop, Cart, Account, and Checkout pages will not work, and you’ll find these pages in the Trash. You’ll need to replace them with Custom Links.

Update Theme Template Files

Because Shopp is no longer using Pages, you can no longer choose a Template for those pages, or choose a layout option (available on some theme frameworks). This means you’ll likely need to create some new templates, or update your existing templates. The changes required generally differ depending on which theme or framework you’re using, but you’d be served to update your Theme to the latest version available. I’ll cover more specific changes in another article (to come later).

At this point, you should be done. Check thru your site to make sure there aren’t any major problems.

OMG THINGS ARE BROKEN!

If you’ve arrived at this point, then it’s a good thing you did the upgrade on a test site and not your live site, right? There are a slew of issues I’ve seen people have, and each one is a different animal, but the best thing to do is try narrowing the problem down as much as possible. My advice is to contact the Shopp Help Desk and let them help you out.

Processing Custom Post Type Content in WordPress

I’m using WordPress custom post types in a project right now, which requires a number of new content sections that are similar to the_post(). In the WP back end, the new content panels are created using add_meta_box() with the TinyMCE WYSIWYG editor so that HTML can easily be added to the content. However, since I have to retrieve the meta box content using get_post_meta(), none of the usual content filters are applied, so we just get the text and any hand-entered HTML, but no automatic paragraph and line break tags or shortcodes. In this case, we need to run the following code on those pieces of content:

echo apply_filters('the_content',$content);

Often when I post code related bits here, it’s for future reference for myself. I know I’m going to need this again, so I know to look for it here.