- jobs/OneTimeMessages->sendMessageToApplicantsStillWaiting now accept

new message senderId to specify the sender for all the messages
- jobs/OneTimeMessages->sendMessageToApplicantsStillWaiting adapted code
to make use of the new method CLMessagesModel->sendExplicitTemplateSenderId
- jobs/OneTimeMessages->sendMessageToApplicantsStillWaiting now logs the
number of prestudents retrieved from database
- Renamed CLMessagesModel->sendExplicitTemplate as CLMessagesModel->sendExplicitTemplateSenderId
- Added new parameter sender_id to CLMessagesModel->sendExplicitTemplateSenderId to specify the sender person id
- Added new public method sendExplicitTemplate to CLMessagesModel as
wrapper method for sendExplicitTemplateSenderId
- CLMessagesModel->sendExplicitTemplate tries to retrieve the sender id
from the authentication session
This commit is contained in:
Paolo
2020-03-31 20:21:18 +02:00
parent 1376509a37
commit 625b0f1167
2 changed files with 24 additions and 11 deletions
@@ -29,8 +29,9 @@ class OneTimeMessages extends JOB_Controller
* - The given semester (ex WS2020)
* - How long since applicant (months)
* - The given template id to be used as message subject and body (vorlage_kurzbz)
* The sender of all the messages is specified by the parameter senderId (sender person_id)
*/
public function sendMessageToApplicantsStillWaiting($studyCourseType, $semester, $months, $messageTemplate)
public function sendMessageToApplicantsStillWaiting($senderId, $studyCourseType, $semester, $months, $messageTemplate)
{
$this->logInfo('Send message to applicants still waiting start');
@@ -94,11 +95,12 @@ class OneTimeMessages extends JOB_Controller
$prestudentIdsArray[] = $dbPrestudent->prestudent_id;
}
$sendMessage = $this->CLMessagesModel->sendExplicitTemplate(
$prestudentIdsArray, // prestudents id
null, // organization unit
$messageTemplate, // template id
null // extra variables
$sendMessage = $this->CLMessagesModel->sendExplicitTemplateSenderId(
$senderId, // sender person id
$prestudentIdsArray, // prestudents id
null, // organization unit
$messageTemplate, // template id
null // extra variables
);
if (isError($sendMessage))
@@ -111,6 +113,8 @@ class OneTimeMessages extends JOB_Controller
)
);
}
$this->logInfo('Total amount of prestudents: '.count($prestudentIdsArray));
}
$this->logInfo('Send message to applicants still waiting end');