We need a Wordpress plugin script that will redirect incoming users to one of two different URLs based on how long it has been since they joined our email list.
We currently add our email subscribers to an AWeber email list. AWeber has recently published an API. We have an automated sequence of emails that gets sent to these users after they join our list.
In one of the automated follow-up emails, we ask users to click a link that sends them to our website. We want them to land on the script, and the script will:
1) Identify the email address of the incoming user. AWeber can append the user's email address to the link automatically as the user clicks the link inside the email. The script you create can parse their email address that way.
2) Fetch the user's signup date through the AWeber API. If the user has been signed up for less than X days, then the script should redirect their browser to URL1. If the user has been signed up for more than X days, redirect them to URL2.
Ideally, this would be coded as a Wordpress plugin. We would like the ability to easily set/change URL1 and URL2 and alter the X number of days from their signup date that their redirection URL changes.
To give you an idea of why we need this: About 2 weeks after people have joined our email list we offer them the chance to buy a product. But we only want them to be able to purchase the product for about a week, and after that, they cannot purchase. So, we will send them an email telling them that they can now purchase the product. If they click on the link in the email, they go through the script on our website, and the script determines that it has been less than X days - so they get redirected to the sales page for the product. After a week, we send them another email telling them that they can no longer purchase. If they click the link (even the link in the older email) they will be redirected to a different URL and will not be able to buy (unless they somehow remember the exact URL that the script originally redirected them to - unlikely).
We have had another programmer look at this and he was unable to get it to work. He said that AWeber's API was poor and wouldn't allow him to code it. We aren't sure if he's right and we want a second opinion, because this does not seem very complicated.
AWeber's API can be found here: [url removed, login to view]