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!
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!