switch($_GET["action"]) {
default:
print "
MAIL LIST REGISTRATION PAGE
Welcome to Bialik's Parent Mail List registration page. Please be aware that ONLY current Bialik parents may sign up to receive school information via email. If you have reached this page in error, please
click here to be directed to our Prospective Parent email signup list, or
click here to return to the Bialik HDS home page.
CURRENT PARENTS: Please note that Bialik's group email signup is a two step process - this allows us to avoid misuse of the system and to protect your privacy.
- STEP ONE: To begin, please fill out the form below.
- STEP TWO: To complete the process, you must confirm your subscription by clicking a link in a confirmation email that will be sent to your inbox.
Parents may sign up for more than one class at the same time. Please place a checkmark beside the appropriate class for each active student attending Bialik this school year.
It is important to remember that, if you subscribe two email addresses to these lists, confirming one address does not automatically confirm the second; the owner of each email address must complete \"STEP TWO\" independently.
Bialik respects the privacy of all members of the extended Bialik \"Family\".
Click here to read our privacy policy.
";
$mac_ie=array("Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)","Mozilla/4.0 (compatible; MSIE 5.21; Mac_PowerPC)","Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)","Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)");
$agent=getenv("HTTP_USER_AGENT");
if(in_array($agent,$mac_ie)) {
print "
* This registration form uses technology that is not supported by Internet Explorer 5 for the Mac.
";
}
break;
case "confirm":
// this is for when they click on the confirmation link in the email
print "
Mail List Confirmation
";
$email=base64_decode($_GET['e']);
$time=base64_decode($_GET['t']);
// do the update
$q="UPDATE parents set optin=1,subscribe=1,confirm_date='".date("Y-m-d H:i:s")."' where email='$email' and idate='$time'";
$res=mysql_query($q,$c);
$affected=mysql_affected_rows();
// check to see if it was added
if($affected==1) {
$values=SelectQuery("parents","fname,lname,class","where email='$email'");
foreach($values as $v) {
$fname=$v[0];
$lname=$v[1];
$class=$v[2];
}
// show the message
print "Thank you $fname $lname.
You have successfully registered your email address \"$email\".
You are now subscribed to the following list(s): $class
";
// send the confirmation email
$to=$email;
$headers="From: confirm@bialik.ca\n";
$subject="CONGRATULATIONS - Bialik group email subscription COMPLETE!";
$content="Dear $fname $lname,\r\n";
$content.="You have successfully registered for group emails to be sent from the following class(es):\r\n\r\n";
$content.="$class\r\n\r\n";
$content.="Your emails will be sent to the address $email\r\n\r\n";
$content.="Bialik's teaching staff and administration send out group emails on varying schedules; you may expect to receive your first group email within approximately two weeks.\r\n";
$content.="Your group email subscription will automatically expire after the end of the current school year.\r\n";
mail($to,$subject,$content,$headers);
}
// otherwise see if it was already there
else {
$q="SELECT count(id) from parents where email='$email' and idate='$time'";
$res=@mysql_query($q,$c);
while($row=mysql_fetch_row($res)) {
$already=$row[0];
}
if($already==1) {
print "Email address \"$email\" is already subscribed.
";
}
// or there was an error
else {
print "Unknown confirmation error.
";
}
}
break;
/*
This is new as of October 23, 2009 as a request from Jesse to have parents be able to regenerate the confirmation email
*/
case "resend":
// set up the mailer for the optin
$e=base64_encode($_GET['email']);
$to=$_GET['email'];
$headers="From: confirm@bialik.ca\n";
$subject="URGENT - ACTION REQUIRED to complete Bialik group email subscription!";
$content="This email confirms that you are a current Bialik parent and that you wish to sign up for group emails from Bialik Hebrew Day School.\r\n\r\n";
$content.="Please click the link below to complete the registration process and add your name and email address to the appropriate list(s).\r\n\r\n";
$content.="http://www.bialik.ca/register.html?action=confirm&e=$e&t=".$_GET["t"]."\r\n\r\n";
$content.="If the link above does not automatically open your web browser to a \"Welcome page\", please cut and paste the link into your web browser's address field and press the \"return\" or \"enter\" key on your keyboard to reach the \"Welcome page\" and confirm your registration.\r\n\r\n";
$content.="This email expires within 7 days. If you have not confirmed your registration within this time period, please return to http://www.bialik.ca/register.html and subscribe again.\r\n\r\n";
$content.="If you have been subscribed to this list in error, please accept our apologies and click on the link below to be removed.\r\n";
$content.="http://www.bialik.ca/unsubscribe.html?e=$e&l=parents&action=remove\r\n";
mail($to,$subject,$content,$headers);
print "
MAIL LIST REGISTRATION PAGE
A confirmation email has been sent to ".$_GET["email"]."
";
break;
}
?>