HOR-4825
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\BusinessModel\EmailEvent;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
class Processes
|
||||
@@ -4183,26 +4184,19 @@ class Processes
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function createEmailEvent($processUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
$emailEvent = new \ProcessMaker\BusinessModel\EmailEvent();
|
||||
|
||||
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();
|
||||
$arrayEmailServerDefault = $emailServer->getEmailServerDefault();
|
||||
|
||||
$emailEvent = new EmailEvent();
|
||||
foreach ($arrayData as $value) {
|
||||
if (isset($value['__EMAIL_SERVER_UID_PRESERVED__']) && $value['__EMAIL_SERVER_UID_PRESERVED__'] === true) {
|
||||
unset($value['__EMAIL_SERVER_UID_PRESERVED__']);
|
||||
} else {
|
||||
unset($value['EMAIL_EVENT_FROM']);
|
||||
unset($value['EMAIL_SERVER_UID']);
|
||||
if (!empty($arrayEmailServerDefault)) {
|
||||
$value['EMAIL_EVENT_FROM'] = $arrayEmailServerDefault['MESS_ACCOUNT'];
|
||||
$value['EMAIL_SERVER_UID'] = $arrayEmailServerDefault['MESS_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
$emailEventData = $emailEvent->save($processUid, $value);
|
||||
|
||||
@@ -466,8 +466,17 @@ class EmailEvent
|
||||
}
|
||||
$arrayData = $this->existsEvent($prj_uid, $eventUid);
|
||||
if (sizeof($arrayData)) {
|
||||
$oEmailServer = new EmailServer();
|
||||
$configEmailData = $oEmailServer->getEmailServer($arrayData[7]);
|
||||
$emailServer = new EmailServer();
|
||||
if (empty($arrayData[7])){
|
||||
$configEmailData = $emailServer->getEmailServerDefault();
|
||||
//We will to show a message, if is not defined the email server default
|
||||
if(empty($configEmailData)){
|
||||
$emailServer->throwExceptionIfNotExistsEmailServer('', 'MESS_UID');
|
||||
}
|
||||
} else {
|
||||
$configEmailData = $emailServer->getEmailServer($arrayData[7]);
|
||||
}
|
||||
|
||||
$emailGroupTo = [];
|
||||
$emailTo = '';
|
||||
$prfUid = $arrayData[6];
|
||||
|
||||
Reference in New Issue
Block a user