PMC-40: Action by Email: Email response configuration

This commit is contained in:
Gustavo Silva
2018-11-14 15:00:10 -04:00
committed by Ronald Q
parent 48e870fab3
commit ab11f33747
8 changed files with 1033 additions and 268 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -50,6 +50,26 @@ class SpoolRun
$this->mailEreg = "/^([\w\-_\+\.']+@[\w\-_\.]+\.\w{2,5}+)$/";
}
/**
* Set the $spool_id
*
* @param string
*/
public function setSpoolId($v)
{
$this->spool_id = $v;
}
/**
* Get the $spool_id
*
* @return string
*/
public function getSpoolId()
{
return $this->spool_id;
}
/**
* get all files into spool in a list
*

View File

@@ -5,6 +5,7 @@ use ProcessMaker\BusinessModel\EmailServer;
use ProcessMaker\ChangeLog\ChangeLog;
/*----------------------------------********---------------------------------*/
use ProcessMaker\Core\System;
use ProcessMaker\Util\WsMessageResponse;
class WsBase
{
@@ -947,7 +948,8 @@ class WsBase
$spool->sendMail();
if ($spool->status == 'sent') {
$result = new WsResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
$result = new WsMessageResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
$result->setAppMessUid($spool->getSpoolId());
} else {
$result = new WsResponse(29, $spool->status . ' ' . $spool->error . print_r($setup, 1));
}

View File

@@ -300,5 +300,24 @@ class AppMessage extends BaseAppMessage
return $messages;
}
/**
* Get the APP_MSG_BODY related to the key
*
* @param string $key
*
* @return string
* @throws Exception
*/
public static function getAppMsgBodyByKey($key)
{
try {
$appMessage = AppMessagePeer::retrieveByPk($key);
return $appMessage->getAppMsgBody();
} catch (Exception $error) {
throw $error;
}
}
}