Merged in bugfix/PMCORE-864 (pull request #7273)
PMCORE-864 Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
@@ -111,6 +111,16 @@ class SpoolRun
|
||||
return $this->spoolId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fileData property
|
||||
*
|
||||
* @param array $fileData
|
||||
*/
|
||||
public function setFileData($fileData)
|
||||
{
|
||||
$this->fileData = $fileData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fileData property
|
||||
*
|
||||
|
||||
@@ -1007,10 +1007,21 @@ class WsBase
|
||||
|
||||
$result = "";
|
||||
if ($gmail != 1) {
|
||||
$closure = function() use ($setup, $messageArray, $gmail, $to) {
|
||||
// Create always the record in APP_MESSAGE table
|
||||
$spool = new SpoolRun();
|
||||
$spool->setConfig($setup);
|
||||
$spool->create($messageArray);
|
||||
|
||||
// Get the data of the record created
|
||||
$fileData = $spool->getFileData();
|
||||
$fileData['spoolId'] = $spool->getSpoolId();
|
||||
|
||||
// Create the closure and send the required data
|
||||
$closure = function() use ($setup, $fileData, $gmail, $to) {
|
||||
$spool = new SpoolRun();
|
||||
$spool->setConfig($setup);
|
||||
$spool->create($messageArray);
|
||||
$spool->setSpoolId($fileData['spoolId']);
|
||||
$spool->setFileData($fileData);
|
||||
$spool->sendMail();
|
||||
return $spool;
|
||||
};
|
||||
|
||||
@@ -190,6 +190,7 @@ class JobsManager
|
||||
$callback($environment);
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage() . ": " . $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
});
|
||||
$instance->delay($this->delay);
|
||||
|
||||
Reference in New Issue
Block a user