function createAndSendEmail_RegistrationNotice($inputValues, $key, $isParticipant)
 {
     // create subject
     $subject = "A friend registered you for T9Hacks! Please complete your registration.";
     // create email message
     $message = EmailHelperClass::createEmail_RegistrationNotice($inputValues, $key, $isParticipant);
     // create headers
     $email = $inputValues['email'];
     $sendTo = $inputValues['name'] . " <{$email}>";
     $headers = EmailHelperClass::createHeaders($subject, $sendTo);
     // send email
     $emailResult = mail($sendTo, $subject, $message, $headers);
     // return result
     return $emailResult;
 }
Esempio n. 2
0
$footer = EmailHelperClass::createEmailFooter("[[NAME]]");
// create input values for all
$inputValues = array("name" => "Tester McTesterson", "email" => "*****@*****.**", "shirt" => "Medium", "comment" => "None", "area" => "Web Dev", "dinner" => 0, "breakfast" => 0, "lunch" => 1, "friendName" => "Friend of Tester", "link" => "");
foreach ($inputValues as $key => $value) {
    ${$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);