$firstEmail = true; $textList = ""; $firstText = true; $callList = ""; $firstCall = true; while ($row = mysql_fetch_assoc($result)) { if ($row['Email_Preferred'] == 1) { if (!$firstEmail) { $emailList .= ","; } $emailList .= $row["Email"]; $firstEmail = false; } if ($row['Text_Preferred'] == 1) { if (!$firstText) { $textList .= ","; } $textList .= $row["Phone_Number"]; $firstText = false; } if ($row['Call_Preferred'] == 1) { if (!$firstCall) { $callList .= ","; } $callList .= $row["Phone_Number"]; $firstCall = false; } } SendEmails($emailList, "North Texas Food Bank Notification", "This is a reminder that you are scheduled to volunteer tomorrow!", "*****@*****.**"); SendTexts($textList, "This is a reminder that you are scheduled to volunteer tomorrow at the North Texas Food Bank!"); echo "Notifications sent! Do not reload this page!";
$firstEmail = true; $textList = ""; $firstText = true; $callList = ""; $firstCall = true; while ($row = mysql_fetch_assoc($result)) { if ($row['Email_Preferred'] == 1) { if (!$firstEmail) { $emailList .= ","; } $emailList .= $row["Email"]; $firstEmail = false; } if ($row['Text_Preferred'] == 1) { if (!$firstText) { $textList .= ","; } $textList .= $row["Phone_Number"]; $firstText = false; } if ($row['Call_Preferred'] == 1) { if (!$firstCall) { $callList .= ","; } $callList .= $row["Phone_Number"]; $firstCall = false; } } SendEmails($emailList, "North Texas Food Bank Cancelation", "Due to unforseen circumstances tomorrow's volunteer event has been canceled. Sorry for the inconvenience.", "*****@*****.**"); SendTexts($textList, "Due to unforseen circumstances tomorrow's volunteer event at the North Texas Food Bank has been canceled. Sorry for the inconvenience."); echo "Cancelations sent! Do not reload this page!";