PMCORE-864
This commit is contained in:
@@ -111,6 +111,16 @@ class SpoolRun
|
|||||||
return $this->spoolId;
|
return $this->spoolId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the fileData property
|
||||||
|
*
|
||||||
|
* @param array $fileData
|
||||||
|
*/
|
||||||
|
public function setFileData($fileData)
|
||||||
|
{
|
||||||
|
$this->fileData = $fileData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the fileData property
|
* Get the fileData property
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1007,10 +1007,21 @@ class WsBase
|
|||||||
|
|
||||||
$result = "";
|
$result = "";
|
||||||
if ($gmail != 1) {
|
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 = new SpoolRun();
|
||||||
$spool->setConfig($setup);
|
$spool->setConfig($setup);
|
||||||
$spool->create($messageArray);
|
$spool->setSpoolId($fileData['spoolId']);
|
||||||
|
$spool->setFileData($fileData);
|
||||||
$spool->sendMail();
|
$spool->sendMail();
|
||||||
return $spool;
|
return $spool;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ class JobsManager
|
|||||||
$callback($environment);
|
$callback($environment);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error($e->getMessage() . ": " . $e->getTraceAsString());
|
Log::error($e->getMessage() . ": " . $e->getTraceAsString());
|
||||||
|
throw $e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$instance->delay($this->delay);
|
$instance->delay($this->delay);
|
||||||
|
|||||||
Reference in New Issue
Block a user