mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
- 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:
@@ -422,17 +422,26 @@ class Messages_model extends CI_Model
|
||||
|
||||
return success('Messages sent successfully');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends a new message using the given template and information present in parameter prestudents
|
||||
* Extra variables can be added using parameter $msgVars
|
||||
* Wrapper method for sendExplicitTemplateSenderId
|
||||
* The sender id is retrieved from the authentication session, if not present an error would be raised
|
||||
*/
|
||||
public function sendExplicitTemplate($prestudents, $oe_kurzbz, $vorlage_kurzbz, $msgVars)
|
||||
{
|
||||
// Retrieves the sender id
|
||||
$sender_id = isLogged() ? getAuthPersonId() : null;
|
||||
if (!is_numeric($sender_id)) $sender_id = $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID);
|
||||
$sender_id = getAuthPersonId();
|
||||
if (!is_numeric($sender_id)) show_error('The current logged user person_id is not defined');
|
||||
|
||||
return $this->sendExplicitTemplateSenderId($sender_id, $prestudents, $oe_kurzbz, $vorlage_kurzbz, $msgVars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a new message using the given template and information present in parameter prestudents
|
||||
* Extra variables can be added using parameter $msgVars
|
||||
*/
|
||||
public function sendExplicitTemplateSenderId($sender_id, $prestudents, $oe_kurzbz, $vorlage_kurzbz, $msgVars)
|
||||
{
|
||||
// Retrieves message vars data for the given user/s
|
||||
$msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudents);
|
||||
if (isError($msgVarsData)) show_error(getError($msgVarsData));
|
||||
|
||||
Reference in New Issue
Block a user