HOR-2162
[Email server selection ABE] Send ABE notification in run cases
This commit is contained in:
@@ -21,7 +21,12 @@ class actionsByEmailCoreClass extends PMPlugin
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendActionsByEmail($data)
|
/**
|
||||||
|
* @param $data
|
||||||
|
* @param $dataAbe
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function sendActionsByEmail($data, $dataAbe)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// Validations
|
// Validations
|
||||||
@@ -73,7 +78,11 @@ class actionsByEmailCoreClass extends PMPlugin
|
|||||||
}
|
}
|
||||||
G::LoadClass('pmFunctions');
|
G::LoadClass('pmFunctions');
|
||||||
|
|
||||||
$emailSetup = getEmailConfiguration();
|
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();
|
||||||
|
|
||||||
|
$emailSetup = ($dataAbe['ABE_EMAIL_SERVER_UID'] != '') ?
|
||||||
|
$emailServer->getEmailServer($dataAbe['ABE_EMAIL_SERVER_UID'], true) :
|
||||||
|
$emailServer->getEmailServerDefault();
|
||||||
|
|
||||||
if (!empty($emailSetup)) {
|
if (!empty($emailSetup)) {
|
||||||
require_once 'classes/model/AbeConfiguration.php';
|
require_once 'classes/model/AbeConfiguration.php';
|
||||||
@@ -144,8 +153,6 @@ class actionsByEmailCoreClass extends PMPlugin
|
|||||||
// Email
|
// Email
|
||||||
$_SESSION['CURRENT_DYN_UID'] = $configuration['DYN_UID'];
|
$_SESSION['CURRENT_DYN_UID'] = $configuration['DYN_UID'];
|
||||||
|
|
||||||
$scriptCode = '';
|
|
||||||
|
|
||||||
$__ABE__ = '';
|
$__ABE__ = '';
|
||||||
$conf = new Configurations();
|
$conf = new Configurations();
|
||||||
$envSkin = defined("SYS_SKIN") ? SYS_SKIN : $conf->getConfiguration('SKIN_CRON', '');
|
$envSkin = defined("SYS_SKIN") ? SYS_SKIN : $conf->getConfiguration('SKIN_CRON', '');
|
||||||
@@ -185,7 +192,6 @@ class actionsByEmailCoreClass extends PMPlugin
|
|||||||
$__ABE__.='</tr></table><br />';
|
$__ABE__.='</tr></table><br />';
|
||||||
break;
|
break;
|
||||||
case 'LINK':
|
case 'LINK':
|
||||||
// $__ABE__ .= $dynaform->render(PATH_FEATURES . 'actionsByEmail/xmlform.html', $scriptCode) . '<br />';
|
|
||||||
$__ABE__ .= '<a href="' . $link . 'DataForm?APP_UID=' . G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY) . '&DYN_UID=' . G::encrypt($configuration['DYN_UID'], URL_KEY) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank">Please complete this form</a>';
|
$__ABE__ .= '<a href="' . $link . 'DataForm?APP_UID=' . G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY) . '&DYN_UID=' . G::encrypt($configuration['DYN_UID'], URL_KEY) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank">Please complete this form</a>';
|
||||||
break;
|
break;
|
||||||
// coment
|
// coment
|
||||||
@@ -290,7 +296,6 @@ class actionsByEmailCoreClass extends PMPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
G::LoadClass('wsBase');
|
G::LoadClass('wsBase');
|
||||||
|
|
||||||
$wsBaseInstance = new wsBase();
|
$wsBaseInstance = new wsBase();
|
||||||
$result = $wsBaseInstance->sendMessage(
|
$result = $wsBaseInstance->sendMessage(
|
||||||
$data->APP_UID,
|
$data->APP_UID,
|
||||||
@@ -301,7 +306,12 @@ class actionsByEmailCoreClass extends PMPlugin
|
|||||||
$subject,
|
$subject,
|
||||||
$configuration['ABE_TEMPLATE'],
|
$configuration['ABE_TEMPLATE'],
|
||||||
$caseFields['APP_DATA'],
|
$caseFields['APP_DATA'],
|
||||||
'');
|
null,
|
||||||
|
true,
|
||||||
|
0,
|
||||||
|
$emailSetup,
|
||||||
|
0
|
||||||
|
);
|
||||||
$abeRequest['ABE_REQ_STATUS'] = ($result->status_code == 0 ? 'SENT' : 'ERROR');
|
$abeRequest['ABE_REQ_STATUS'] = ($result->status_code == 0 ? 'SENT' : 'ERROR');
|
||||||
|
|
||||||
$body = '';
|
$body = '';
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
if($dataAbe['ABE_TYPE']!='' && $data->USR_UID!=''){
|
if($dataAbe['ABE_TYPE']!='' && $data->USR_UID!=''){
|
||||||
G::LoadClass('actionsByEmailCore');
|
G::LoadClass('actionsByEmailCore');
|
||||||
$actionsByEmail = new actionsByEmailCoreClass();
|
$actionsByEmail = new actionsByEmailCoreClass();
|
||||||
$actionsByEmail->sendActionsByEmail($data);
|
$actionsByEmail->sendActionsByEmail($data, $dataAbe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user