PDA

View Full Version : Collect YMLP newsletter signups during a Plimus sale


Ryan Clark
05-14-2006, 12:22 AM
Hi everyone. I thought this might be useful to some of you, since I know a number of you use Plimus and YMLP.

Plimus's "Instant Notification URL" combined with "Custom Fields" and some YMLP trickery can allow users to opt-in to your newsletter during the purchase process! It doesn't get any better: These particular users have already shown they'll purchase your games; they're exactly the type of user you'd like to add to your newsletter :)

Here's how I did it:

1. I added a general "Would you like to sign up for the <b>Grubby Games newsletter</b>? We'll send you an email when we have <b>new</b> games for you to play!" header to the Plimus contract's custom fields, and then added a "Sign up!" checkbox field.

2. I uploaded the following script to a PHP file on my server:

<?php
if ($_POST["Sign_up!"] == "Y")
{
$email=$_POST["email"];
$username="YOUR_YMLP_USERNAME";

$request="YMLP0=".urlencode($email);
$header.="POST /submit.php?$username HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($request) . "\r\n\r\n";
$fp=fsockopen ('www.ymlp.com', 80, $errno, $errstr, 30);

if ($fp) fputs($fp, $header.$request);
}
?>

3. I pointed the contract's "Instant Notification URL" to the above script, wherever it happened to be located on my server.

The script will check the value of the "Sign Up!" checkbox, and if it has been checked, it will grab the "email" post variable and send it on to the YMLP submit script.

It looks like over 50% of our sales now result in a newsletter signup, which is great. We're no longer missing out on these important email addresses!

The YMLP support staff helped me get this working; thanks YMLP!

Sharpfish
05-14-2006, 01:39 AM
Thanks for the code and info Ryan, that looks great. I will implement that when I finally get around to finishing the website stuff (and when I hopefully start selling some actual games). ;)

Olivier
05-14-2006, 10:09 AM
That's a nice one Ryan. I didn't think of automatizing the process despite I'm already sending custom signup notifications to YMLP with the downloads: http://forums.indiegamer.com/showthread.php?t=5660
I already have a newsletter signup checkbox on my order pages but for the moment I have to import myself the e-mail adresses in my subscribers database.
Your method is much practical even if the subscriber has to confirm his subscription, which in the case of a purchase seems a bit *too much*.

Edit: Yes YMLP staff is great! :)

berserker
03-13-2007, 02:46 AM
Any ideas how to make it with RegNow?

tentons
03-13-2007, 02:03 PM
Great idea. Thanks for sharing!

Greg Squire
03-13-2007, 05:37 PM
I was wondering if that could be done somehow. Great Tip. Thanks!