diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 2833a8eb5..776ef207e 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -831,7 +831,7 @@ function getEmailConfiguration () * @param array | $aAttachment = array() | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email. * @param boolean | $showMessage = true | Show message | Optional parameter. * @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case. - * @param array | $config = array() | Alternative Email Settings | An optional array: An array of parameters to be used in the Email sent (EmailEngine, Server, Port, FromEmail, Username, UserPassword, and SecureConnection). + * @param array | $config = array() | Alternative Email Settings | 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). * @return int | | result | Result of sending email * */ diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index 883ace91a..43f59ae7a 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -914,37 +914,13 @@ class wsBase $aAttachment = null, $showMessage = true, $delIndex = 0, - $config = null + $config = array() ) { try { if (!class_exists('System')) { G::LoadClass('system'); } - $aSetup = System::getEmailConfiguration(); - - if($config != null){ - if(isset($config['EmailEngine']) && $config['EmailEngine'] != ""){ - $aSetup['MESS_ENGINE'] = $config['EmailEngine']; //EmailEngine - } - if(isset($config['Server']) && $config['Server'] != ""){ - $aSetup['MESS_SERVER'] = $config['Server']; //Server - } - if(isset($config['Port']) && $config['Port'] != ""){ - $aSetup['MESS_PORT'] = $config['Port']; //port - } - if(isset($config['UserName']) && $config['UserName'] != ""){ - $aSetup['MESS_ACCOUNT'] = $config['UserName']; //userName - } - if(isset($config['FromEmail']) && $config['FromEmail'] != ""){ - $aSetup['MESS_FROM_MAIL'] = $config['FromEmail']; //fromEmail - } - if(isset($config['UserPassword']) && $config['UserPassword'] != ""){ - $aSetup['MESS_PASSWORD'] = $config['UserPassword']; //userPassword - } - if(isset($config['SecureConnection']) && $config['SecureConnection'] != ""){ - $aSetup['SMTPSecure'] = $config['SecureConnection']; //secureConnection - } - } + $aSetup = !empty($config) ? $config : System::getEmailConfiguration(); $oSpool = new spoolRun();