diff --git a/src/UNL/UCARE/Year1Application.php b/src/UNL/UCARE/Year1Application.php index ded18f2467cf8317cd3f8daa57393938727f2c22..b3bdbac5fa9b4f901adceb63bdb208c2eb13c18b 100644 --- a/src/UNL/UCARE/Year1Application.php +++ b/src/UNL/UCARE/Year1Application.php @@ -110,10 +110,19 @@ You will be asked to comment on the ability of the student to carry out the prop You must log in using your My.UNL (Blackboard) username and password to complete the application. Access the application at the link below:<br /> <a href="'.UNL_UCARE_Controller::getURL().'?view=sponsor">'.UNL_UCARE_Controller::getURL().'?view=sponsor</a></p>'; - $pf = new UNL_Peoplefinder(); - $sponsor = $pf->getUID($this->sponsor_uid); + $mail = 'ldamuth1@unl.edu'; + + if ($sponsor = json_decode(file_get_contents('http://peoplefinder.unl.edu/?uid='.$this->sponsor_uid.'&format=json'), true)) { + if (isset($sponsor['mail'])) { + if (is_array($sponsor['mail'])) { + $mail = $sponsor['mail'][0]; + } else { + $mail = $sponsor['mail']; + } + } + } - UNL_UCARE_Controller::sendHTMLEmail($sponsor->mail, 'UCARE Application', $text); + UNL_UCARE_Controller::sendHTMLEmail($mail, 'UCARE Application', $text); } function emailApplicant()