function createAndSendEmail_Approval($personRecord)
 {
     $name = $personRecord[0]["name"];
     $email = $personRecord[0]["email"];
     $sendTo = $name . " <{$email}>";
     // create subject
     $subject = "Welcome to T9Hacks!";
     // create email message
     $message = EmailHelperClass::createEmail_Approval($name);
     // create headers
     $headers = EmailHelperClass::createHeaders($subject, $sendTo);
     // send email
     $emailResult = mail($sendTo, $subject, $message, $headers);
     // return result
     return $emailResult;
 }
예제 #2
0
    ${$key} = $value;
}
$link = "www.t9hacks.org/signupPages/signup-participant2.php?key={$key}";
// test confirmation email
if (false) {
    echo EmailHelperClass::createEmail_Confirmation($inputValues, $key, true);
    echo EmailHelperClass::createEmail_Confirmation($inputValues, $key, false);
}
// test registration email
if (false) {
    echo EmailHelperClass::createEmail_RegistrationNotice($inputValues, $key, true);
    echo EmailHelperClass::createEmail_RegistrationNotice($inputValues, $key, false);
}
// test registration email
if (false) {
    echo EmailHelperClass::createEmail_Approval("a");
    echo EmailHelperClass::createEmail_Rejection("a");
    echo EmailHelperClass::createEmail_ReminderToCompleteRegistration("a", "key");
}
// reminder
if (true) {
    // create email message
    $message = file_get_contents("emails/2weeksparticipant.php");
    // replace variables
    $message = str_replace("[[HEADER]]", $header, $message);
    $message = str_replace("[[FOOTER]]", $footer, $message);
    $message = str_replace("[[LINKSTYLES]]", $linkStyles, $message);
    $message = str_replace("[[NAME]]", $name, $message);
    $message = str_replace("[[LINK]]", $link, $message);
    $dist = "\r\n\t\t<li style='padding: 0 0 20px;'>\r\n\t\t\t<p style='margin: 0; padding: 0;'>\r\n\t\t\t\t<b style='color: #553377;font-size: 1.2em;'>CONFIRM THAT YOU ARE COMING!</b>  We noticed\r\n\t\t\t\tthat you are traveling to T9Hacks from out of state.  We require confirmation from participants\r\n\t\t\t\tthat are traveling from a distance. Keep in mind that we we cannot cover or reimburse any \r\n\t\t\t\ttravel costs.  Please confirm with Brittany (brittany.kos@colorado.edu) if you are attending or \r\n\t\t\t\tnot.  If we do not hear from you by the end of Monday, February 8, 2016, we will remove your \r\n\t\t\t\tregistration.\r\n\t\t\t</p>\r\n\t\t</li>\r\n\t\t\t";
    $message = str_replace("[[DISTANCE_REQ]]", $dist, $message);