URL Shortener WP Filter (DIFF Attached)
Posted: January 14th, 2011, 11:12 pm
I've been getting a bunch of clients who sign up and "never" receive the registration email. Most of them find it in their SPAM folder after I tell them to look there. Some are just issues with their PayPal email account vs. the email account they now use.
But I wanted to cut down on the amount of times the registration email is automatically marked as SPAM, it's been an ongoing battle. I've even added SPF1 and domainkey records to my zone file. But still, I get a bunch of these support emails and it's wasting my time.
The best I can figure is that some spam filters just don't like the TinyURL url embedded in the emails. Plus if people can't find the email in their SPAM, I have to manually create the account (since there is no easy way to recreate the registration link).
Well, this morning I set to switch from TinyURL to my own URL Shortening service using YOURLS. The API is a little different but it took me less than 10 minutes to setup, the URL is the same as my site, I get to track all the URLs generated (so it is easier for me to get the user's registration link), and hopefully it'll cut down on my messages being seen as SPAM!
Basically I changed line 32 of s2member/includes/functions/register-access.inc.php from:
if ($shrink && ($tinyurl = ws_plugin__s2member_remote ("http://tinyurl.com/api-create.php?url=" . rawurlencode ($register_link))))
to:
if ($shrink && ($tinyurl = ws_plugin__s2member_remote ( apply_filters( 's2member_remote_shrink_url', "http://tinyurl.com/api-create.php?url=" ) . rawurlencode ($register_link))))
I have YOURLS installed in it's own subdirectory on my site, this is the code I added to my functions.php to hook into the new filter:
function yourls_shrink () {
return "http://leenk.me/reg/yourls-api.php?signature=XXXXXXXX&action=shorturl&format=simple&url=";
}
add_filter( 's2member_remote_shrink_url', 'yourls_shrink');
So now, instead of a TinyURL like this: http://tinyurl.com/XXXXXXX
I get a custom YOURLS like this: http://leenk.me/reg/XXXXXXX
I've never used Bit.ly before, but I imagine someone could simply change the URL to a bit.ly URL if they wanted to use that as the URL shortener... assuming they have a basic API like TinyURL and YOURLS.
This has been running all day without any trouble (yet).
Thoughts?
But I wanted to cut down on the amount of times the registration email is automatically marked as SPAM, it's been an ongoing battle. I've even added SPF1 and domainkey records to my zone file. But still, I get a bunch of these support emails and it's wasting my time.
The best I can figure is that some spam filters just don't like the TinyURL url embedded in the emails. Plus if people can't find the email in their SPAM, I have to manually create the account (since there is no easy way to recreate the registration link).
Well, this morning I set to switch from TinyURL to my own URL Shortening service using YOURLS. The API is a little different but it took me less than 10 minutes to setup, the URL is the same as my site, I get to track all the URLs generated (so it is easier for me to get the user's registration link), and hopefully it'll cut down on my messages being seen as SPAM!
Basically I changed line 32 of s2member/includes/functions/register-access.inc.php from:
if ($shrink && ($tinyurl = ws_plugin__s2member_remote ("http://tinyurl.com/api-create.php?url=" . rawurlencode ($register_link))))
to:
if ($shrink && ($tinyurl = ws_plugin__s2member_remote ( apply_filters( 's2member_remote_shrink_url', "http://tinyurl.com/api-create.php?url=" ) . rawurlencode ($register_link))))
I have YOURLS installed in it's own subdirectory on my site, this is the code I added to my functions.php to hook into the new filter:
function yourls_shrink () {
return "http://leenk.me/reg/yourls-api.php?signature=XXXXXXXX&action=shorturl&format=simple&url=";
}
add_filter( 's2member_remote_shrink_url', 'yourls_shrink');
So now, instead of a TinyURL like this: http://tinyurl.com/XXXXXXX
I get a custom YOURLS like this: http://leenk.me/reg/XXXXXXX
I've never used Bit.ly before, but I imagine someone could simply change the URL to a bit.ly URL if they wanted to use that as the URL shortener... assuming they have a basic API like TinyURL and YOURLS.
This has been running all day without any trouble (yet).
Thoughts?