This commit is contained in:
Israel Bernabe
2019-03-29 10:00:39 -04:00
committed by Paula Quispe
parent bddc2906a6
commit ef84cd1523
15 changed files with 242 additions and 75 deletions

View File

@@ -24,6 +24,7 @@ use ResultSet;
use SpoolRun;
use stdClass;
use Users as ClassUsers;
use WsBase;
/**
* Description of ActionsByEmailService
@@ -366,6 +367,9 @@ class ActionsByEmail
*
* @return string $message
* @throws Exception
*
* @see workflow/engine/methods/actionsByEmail/actionsByEmailAjax.php
* @see \ProcessMaker\Services\Api\ActionsByEmail::forwardMail()
*/
public function forwardMail(array $arrayData)
{
@@ -397,7 +401,7 @@ class ActionsByEmail
'',
$dataRes['APP_UID'],
$dataRes['DEL_INDEX'],
'TEST',
WsBase::MESSAGE_TYPE_ACTIONS_BY_EMAIL,
$dataRes['ABE_REQ_SUBJECT'],
$aSetup['MESS_ACCOUNT'],
$dataRes['ABE_REQ_SENT_TO'],

View File

@@ -14,6 +14,7 @@ use ProcessMaker\Util\Common;
use Propel;
use ResultSet;
use UsersPeer;
use WsBase;
class EmailEvent
{
@@ -455,11 +456,13 @@ class EmailEvent
* @param string $prj_uid Unique id of Project
* @param string $eventUid Unique id of event
* @param array $arrayApplicationData Case data
* @param int $tasId id of task
*
* @return void
* @throws Exception
* @see \Derivation::executeEvent()
*/
public function sendEmail($appUID, $prj_uid, $eventUid, $arrayApplicationData)
public function sendEmail($appUID, $prj_uid, $eventUid, $arrayApplicationData, $tasId = 0)
{
if (!$this->existsEvent($prj_uid, $eventUid)) {
throw new Exception(G::LoadTranslation('ID_EMAIL_EVENT_DEFINITION_DOES_NOT_EXIST'));
@@ -511,7 +514,9 @@ class EmailEvent
}
}
if (!empty($emailTo)) {
PMFSendMessage(
$ws = new WsBase();
$ws->setTaskId($tasId);
$ws->sendMessage(
$appUID,
G::buildFrom($configEmailData),
$emailTo,
@@ -523,7 +528,9 @@ class EmailEvent
[],
true,
0,
$configEmailData
$configEmailData,
0,
WsBase::MESSAGE_TYPE_EMAIL_EVENT
);
} else {
Bootstrap::registerMonolog(

View File

@@ -8,6 +8,7 @@ use G;
use ProcessMaker\Core\System;
use SpoolRun;
use TemplatePower;
use WsBase;
class EmailServer
{
@@ -156,6 +157,7 @@ class EmailServer
*
* @return array, return array with result of send test mail
* @throws Exception
* @see EmailServer->testConnectionByStep()
*/
public function sendTestMail(array $arrayData)
{
@@ -203,7 +205,7 @@ class EmailServer
'',
'',
0,
'TEST',
WsBase::MESSAGE_TYPE_TEST_EMAIL,
G::LoadTranslation("ID_MESS_TEST_SUBJECT"),
G::buildFrom($configuration),
$arrayData["TO"],