PMC-980 Merge remote-tracking branch 'upstream/feature/PMC-43' into bugfix/PMC-980

# Conflicts:
#	workflow/engine/classes/WsBase.php
This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-07-22 11:24:00 -04:00
parent 7355bd3522
commit 7f55e951fa
27 changed files with 2210 additions and 501 deletions

View File

@@ -6,6 +6,7 @@ use ProcessMaker\ChangeLog\ChangeLog;
/*----------------------------------********---------------------------------*/
use ProcessMaker\Core\JobsManager;
use ProcessMaker\Core\System;
use ProcessMaker\Util\WsMessageResponse;
class WsBase
{
@@ -1011,14 +1012,20 @@ class WsBase
$spool->sendMail();
return $spool;
};
$result = new WsResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
$result = new WsMessageResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
switch ($appMsgType) {
case WsBase::MESSAGE_TYPE_EMAIL_EVENT:
case WsBase::MESSAGE_TYPE_PM_FUNCTION:
JobsManager::getSingleton()->dispatch('EmailEvent', $closure);
break;
default :
JobsManager::getSingleton()->dispatch('Email', $closure);
$spool = $closure();
if ($spool->status == 'sent') {
$result = new WsMessageResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
$result->setAppMessUid($spool->getSpoolId());
} else {
$result = new WsResponse(29, $spool->status . ' ' . $spool->error . PHP_EOL . print_r($setup, 1));
}
break;
}
}