" "){ $numberOfFriends++; } } // //insert friends_email $count = 0; $count = count( $_REQUEST["FriendsEmail"] ); $numberfilled = 0; $friendsList = ""; for ($i=0; $i<$count; $i++) { //insert into table if($_REQUEST["FriendsEmail"][$i] > " "){ $sendEmailtoInviter = "Y"; $numberfilled++; $rand_key = md5(time()); $rand_key= rand(0,999999999); $invitDate = date(Y-m-d) ; $_POST[msg] = ereg_replace("'", "´",$_POST[msg]); $InsertStr = "INSERT INTO invitations (Message,Invite_Date,USER_ID, EMAIL, Invited, Type, Random_Key, Fname ) VALUES ( '$_POST[msg]', '$invitDate','" . $_SESSION['sessionUserID'] . "' , '" . $_REQUEST["FriendsEmail"][$i] . "', 'Y', '" . $_REQUEST["Type"][$i] . "', '$rand_key', '" . $_REQUEST["FriendsName"][$i] . "')"; $result = mysql_query($InsertStr) or die(mysql_error()); $lastInvId=mysql_insert_id() ; //************************************************************************************************************************ //* see if user is already a yada member - if so then dont sent the registration email - just put a message in their box //************************************************************************************************************************ //see if user is on the dont send email list $lookupEmail = $_REQUEST["FriendsEmail"][$i]; include "doNotSend.php"; //end of email lookup - result will be $OkToSendEmail = Y or N $SelectStr2 = "SELECT * FROM users where Email = '" . $_REQUEST["FriendsEmail"][$i] . "'"; $result2 = mysql_query($SelectStr2) or die(mysql_error()); if($myrow2=MySQL_fetch_array($result2)){ $sqlM = "update invitations set is_Member = 'Y' where ID = '$lastInvId' "; $resultM = mysql_query($sqlM) or die(mysql_error()); $dateSent=date("Y-m-d") ; $timeSent = date("H:i") ; $friendID = $myrow2["ID"]; $invID = $lastInvId; $proNoun = "their"; if ( $_SESSION["sessionGender"] == "m" ){ $proNoun = "his"; } if ( $_SESSION["sessionGender"] == "f" ){ $proNoun = "her"; } $msgTitle = "Invitation from ".$_SESSION["sessionFname"] . " " . $_SESSION["sessionLname"] ; $sqlInsert = "INSERT INTO messages (From_ID, To_ID, Date_Sent, Time_Sent, Mark_As_Read, The_Text)" ; $sqlInsert = $sqlInsert . " VALUES ('" . $_SESSION["sessionUserID"] . "','$friendID','$dateSent','$timeSent','N','011')" ; $result3 = mysql_query($sqlInsert) or die(mysql_error()); $lastMsgId=mysql_insert_id() ; $message = $_SESSION["sessionFname"] . " " . $_SESSION["sessionLname"] . " has invited you to join $proNoun network.
Click here to accept or reject this invitation."; $SQL3 = "UPDATE messages SET msg_title = '$msgTitle' ,Reply_ID='$lastMsgId', The_Text = '$message' WHERE To_ID ='$friendID' and ID = '$lastMsgId' and The_Text='011' and From_ID = '" . $_SESSION["sessionUserID"]. "'"; $result3 = mysql_query($SQL3) or die(mysql_error()); //***and send and email $to = $_REQUEST["FriendsEmail"][$i]; $fromName = $_SESSION["sessionFname"] . " " . $_SESSION["sessionLname"]; $from = "$fromName "; $fromNamePoss = $_SESSION["sessionFname"] . "'s"; include "emailTerms.php"; $subject = "From $fromName: Join my network!"; $greeting = ""; if ( $_REQUEST["FriendsName"][$i] > " "){ $subject = $_REQUEST["FriendsName"][$i] . ", join my network!"; $greeting = "Hi " . $_REQUEST["FriendsName"][$i] . ",

"; } //begin email message $message = "$subject

" . $greeting . "I just added you as a friend to my network!

Just sign into your fridge and click on your messages where you will be able to accept the invitation! Here's the link to sign in: YadaHome.com

$fromName




-----------------------------------------------------
$emailTerms




"; //end of message $headers = "From: $from\r\n"; $headers .="Reply-To: $_SESSION[sessionEmail] \r\n"; $headers .= "Content-type: text/html\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]"; //$headers .= "Bcc: [email]email@maaking.cXom[/email]"; // now lets send the email. if( $OkToSendEmail == "Y"){ mail($to, $subject, $message, $headers); } //********* } else{ //*********************DID NOT FIND THE FRIEND IN THE USERS TABLE - NOT YET A MEMBER $theGender1 = "they"; $theGender2 = "his or her"; if($_SESSION["sessionGender"] == "f"){ $theGender1 = "she"; $theGender1C = "She"; $theGender2 = "her";} if($_SESSION["sessionGender"] == "m"){ $theGender1 = "he"; $theGender1C = "He"; $theGender2 = "his";} $theLink = "http://yadahome.com/signUpProcess.php?rndid=" . $rand_key . "&invid=" . $lastInvId ; $to = $_REQUEST["FriendsEmail"][$i]; $fromName = $_SESSION["sessionFname"] . " " . $_SESSION["sessionLname"]; $fromEmail = $_SESSION["sessionFname"] . "" . $_SESSION["sessionLname"]; $from = "$fromEmail@YadaHome.com"; $fromNamePoss = $_SESSION["sessionFname"] . "'s"; include "emailTerms.php"; $subject = "Take A Look At My Profile On A Great New Website I Discovered!"; $greeting = "Hi,

"; if ( $_REQUEST["FriendsName"][$i] > " "){ $greeting = "Hi " . $_REQUEST["FriendsName"][$i] . ",

"; $subject = "Take A Look At My Profile On A Great New Website I Discovered!"; } if($_POST[msg] > " "){ $notes = "
". $_POST[msg] ."



"; } else { $notes = " "; } $message = " $subject

" . $greeting . " I've been using YadaHome, a great new website I recently discovered. It has lots of useful features including free organizational tools like shared grocery lists, to do lists, photos, and calendars. Plus, you can network with family and friends! It's free to join, and it would be great to add you to my new network!

Thanks!

$fromName

Check out my YadaHome profile here: http://yadahome.com/profileLimited.php?fid=$_SESSION[sessionUserID]

Get your own free profile here: $theLink

Take a quick tour of YadaHome.com and see all of their cool features here: http:yadahome.com




-----------------------------------------------------
$emailTermsInvitation
"; //end of message $headers = "From: $from \r\n"; $headers .="Reply-To: $_SESSION[sessionEmail] \r\n"; $headers .= "Content-type: text/html\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]"; //$headers .= "Bcc: [email]email@maaking.cXom[/email]"; // now lets send the email. if( $OkToSendEmail == "Y"){ mail($to, $subject, $message, $headers); } if ( $_REQUEST["FriendsName"][$i] > " "){ if ($friendsList > " "){ if($numberOfFriends == 2){ $friendsList .= " and "; }; if( ($numberOfFriends == 3) && ($i == 1) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 3) && ($i == 2) ){ $friendsList .= ", and "; }; if( ($numberOfFriends == 4) && ($i == 1) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 4) && ($i == 2) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 4) && ($i == 3) ){ $friendsList .= ", and "; }; if( ($numberOfFriends == 5) && ($i == 1) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 5) && ($i == 2) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 5) && ($i == 3) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 5) && ($i == 4) ){ $friendsList .= ", and "; }; if( ($numberOfFriends == 6) && ($i == 1) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 6) && ($i == 2) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 6) && ($i == 3) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 6) && ($i == 4) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 6) && ($i == 5) ){ $friendsList .= ", "; }; if( ($numberOfFriends == 6) && ($i == 6) ){ $friendsList .= ", and "; }; } $friendsList .= $_REQUEST["FriendsName"][$i]; //end of build the friends list } } } } //******************************************************************* //* end of send out the email //******************************************************************* //******************************************************************* // remind member to follow up with friends //******************************************************************* if ($sendEmailtoInviter == "Y"){ //$friendsList $to = $_SESSION[sessionEmail]; $from = "friends@yadahome.com"; $toName = $_SESSION["sessionFname"]; $subject = "Remind your friends to join your YadaHome network!"; $headers = "From: $from \r\n"; $headers .="Reply-To: $from \r\n"; $headers .= "Content-type: text/html\r\n"; if($friendsList > " "){ $message = "


 

Dear $toName,

We’ve sent an invitation email on your behalf to $friendsList.  Please remember to call or follow-up with them to make sure they received the email and become a part of your new network!

Thanks for helping make YadaHome the premier place on the Internet to Organize, Connect, and Share!

Best regards,
YadaHome.com





$emailTermsInvitation
"; }else{ $message = "


 

Dear $toName,

We’ve sent an invitation email on your behalf.  Please remember to call or follow-up with them to make sure they received the email and become a part of your new network!

Thanks for helping make YadaHome the premier place on the Internet to Organize, Connect, and Share!

Best regards,
YadaHome.com





$emailTermsInvitation
"; } mail($to, $subject, $message, $headers); } //**************** //* end of reminder //******************************************************************* $msg = "Your invitations have been sent. When an invitation is accepted, you will receive a notice in your YadaHome inbox which is accesible from My Fridge."; } if($_REQUEST['showmsg'] == 'y'){ $msg = "Your invitations have been sent. When an invitation is accepted, you will receive a notice in your YadaHome inbox which is accesible from My Fridge."; } ?> Invite A Friend
connect with friends  

Upload your picture