« How to Syndicate RSS Content | Main | Family Gathering Summer 2004 »
October 29, 2004
How To Automate Requests For White Papers
Here's the deal:
You want to generate more subscribers by offering some "white papers" or "special reports." Since you're going to set up a dozen or so, you don't want to hire a programmer to come in and re program your mailing list program to send out a dozen or so personalized messages that contain the link to the download or URL.
Actually, it might be better to not invoke the mailing list program at all. You want them to request the report, send them a personalized message and ADD them to your web based mailing program without having to handle all of the extra email addresses manually. Oh yes... you don't want to process individual emails either. You would prefer to receive NO email.
So you put a little form on your website that looks like this:
<form METHOD="POST" ACTION="recv_devel.php">
<b>Name:</b><br>
<input TYPE="TEXT" NAME="NAME" VALUE=""><br>
<b>E-mail:</b><br>
<input TYPE="TEXT" NAME="Email" VALUE=""><BR>
<INPUT TYPE="submit" VALUE="Submit">
</form>
Note that the action of the for is a call to a PHP page where the magic happens. Part of the great thing about FORMS and PHP is as soon as the form is submitted the variables are available in the next page for us to work with.
The first part of your new file might contain some acknowledgement for your prospect:
<h2>Thank you</h2>
<P>An email has been sent to you with instructions on how to
download the white paper.</P>
That's it! That's all they see. Even if they use their browsers "view source" assuming maybe they used a fake email address, they still won't get the URL. The URL is enclosed in PHP tags which is not available to the user from the "view source."
The next few lines on the page look like this:
<?
$outputstring = $Email."\n";
$fp = fopen("cgi-bin/mail_list.txt","a");
fwrite ($fp, $outputstring);
fclose($fp);
?>
Here we use three PHP functions fopen(), fwrite() and fclose()
The thing that is the MOST important to make sure you have is the "a" in the fopen() string. This is called a "file mode" and the "a" tells the script the file is being opened to append information to the end of the existing content. That means that each time we add a new email address to the file, it adds a new line and appends it to the end of the content in file. Nothing is over written or is the file altered in any other way.
Once the file has been opened by the script and it understands where in the file it is placing the information the fwrite() function write the email address to the file and then it is closed by fclose().
Now that we have the email address added to our mailing list we need to look after sending a personalized email to our prospect. Here is what the rest of the script will look like:
<?
$toaddress = "$Email";
$subject = "Your Special Report";
$feedback = "Thanks for requesting the special report. I am sure you will find it useful. If you have any questions please feel free to email me\n You can download your special report at
http://homebusiness-websites.com/special_report.pdf\n
Best Regards\n
Steve MacLellan\n";
$additional_headers = "From: steve@homebusiness-websites.com\n"
."Reply-To: steve@homebusiness-websites.com\n";
$mailcontent = "Hi ".$NAME."\n"
."Thank you:\n".$feedback."\n";
mail ($toaddress, $subject, $mailcontent, $additional_headers);
?>
There are a lot of other things that could have been added to this code to format the email better and add error checking to the script. But for the sake of brevity, and understanding the basics, it has been omitted. And if you click on the link for the special report... guess what? There isn't one. (he-he)
If you study the code it should help give you some ideas on how to go about implementing something like this. If you need to hire a programmer to write something a little more complete, send me an email and I can write it any way you want.
Posted by Steve MacLellan at October 29, 2004 03:26 PM
Trackback Pings
TrackBack URL for this entry:
http://www.homebusiness-websites.com/mt/mt-tb.cgi/7
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)