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

@@ -920,34 +920,34 @@ function getEmailConfiguration ()
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFSendMessage.28.29
*
* @param string(32) | $caseId | UID for case | The UID (unique identification) for a case, which is a string of 32 hexadecimal characters to identify the case.
* @param string(32) | $sFrom | Sender | The email address of the person who sends out the email.
* @param string(100) | $sTo | Recipient | The email address(es) to whom the email is sent. If multiple recipients, separate each email address with a comma.
* @param string(100) | $sCc = '' | Carbon copy recipient | The email address(es) of people who will receive carbon copies of the email.
* @param string(100) | $sBcc = ''| Carbon copy recipient | The email address(es) of people who will receive blind carbon copies of the email.
* @param string(50) | $sSubject | Subject of the email | The subject (title) of the email.
* @param string(50) | $sTemplate | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email.
* @param array | $aFields = array() | Variables for email template | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values.
* @param array | $aAttachment = array() | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email.
* @param string(32) | $from | Sender | The email address of the person who sends out the email.
* @param string(100) | $to | Recipient | The email address(es) to whom the email is sent. If multiple recipients, separate each email address with a comma.
* @param string(100) | $cc = '' | Carbon copy recipient | The email address(es) of people who will receive carbon copies of the email.
* @param string(100) | $bcc = ''| Carbon copy recipient | The email address(es) of people who will receive blind carbon copies of the email.
* @param string(50) | $subject | Subject of the email | The subject (title) of the email.
* @param string(50) | $template | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email.
* @param array | $emailTemplateVariables = [] | Variables for email template | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values.
* @param array | $attachments = [] | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email.
* @param boolean | $showMessage = true | Show message | Optional parameter. Set to TRUE to show the message in the case's message history.
* @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case.
* @param string(100) | $config = '' | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure) Or String: UID of Email server .
* @param array | $config = [] | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure) Or String: UID of Email server .
* @return int | | result | Result of sending email
*
* @see class.pmFunctions::PMFSendMessageToGroup()
*/
//@param array | $aFields=array() | An associative array optional | Optional parameter. An associative array where the keys are the variable name and the values are the variable's value.
function PMFSendMessage(
$caseId,
$sFrom,
$sTo,
$sCc,
$sBcc,
$sSubject,
$sTemplate,
$aFields = array(),
$aAttachment = array(),
$from,
$to,
$cc,
$bcc,
$subject,
$template,
$emailTemplateVariables = [],
$attachments = [],
$showMessage = true,
$delIndex = 0,
$config = array()
$config = []
) {
ini_set ( "pcre.backtrack_limit", 1000000 );
ini_set ( 'memory_limit', '-1' );
@@ -955,28 +955,30 @@ function PMFSendMessage(
global $oPMScript;
if (isset( $oPMScript->aFields ) && is_array( $oPMScript->aFields )) {
if (is_array( $aFields )) {
$aFields = array_merge( $oPMScript->aFields, $aFields );
if (isset($oPMScript->aFields) && is_array($oPMScript->aFields)) {
if (is_array($emailTemplateVariables)) {
$emailTemplateVariables = array_merge($oPMScript->aFields, $emailTemplateVariables);
} else {
$aFields = $oPMScript->aFields;
$emailTemplateVariables = $oPMScript->aFields;
}
}
$ws = new WsBase();
$result = $ws->sendMessage(
$caseId,
$sFrom,
$sTo,
$sCc,
$sBcc,
$sSubject,
$sTemplate,
$aFields,
$aAttachment,
$from,
$to,
$cc,
$bcc,
$subject,
$template,
$emailTemplateVariables,
$attachments,
$showMessage,
$delIndex,
$config
$config,
0,
WsBase::MESSAGE_TYPE_PM_FUNCTION
);
if ($result->status_code == 0) {