BUG 3910 Attachments to email messages
this issue was completed and it is working fine
This commit is contained in:
@@ -768,10 +768,11 @@ function getEmailConfiguration () {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//@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.
|
//@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()) {
|
function PMFSendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields = array(), $sAttachment) {
|
||||||
|
|
||||||
G::LoadClass('wsBase');
|
G::LoadClass('wsBase');
|
||||||
$ws = new wsBase ();
|
$ws = new wsBase ();
|
||||||
$result = $ws->sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields);
|
$result = $ws->sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields, $sAttachment);
|
||||||
|
|
||||||
if ( $result->status_code == 0) {
|
if ( $result->status_code == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -779,7 +780,6 @@ function PMFSendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplat
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class spoolRun {
|
|||||||
$this->status = strtolower($aData['app_msg_status']);
|
$this->status = strtolower($aData['app_msg_status']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setData($sUID, $aData['app_msg_subject'], $aData['app_msg_from'], $aData['app_msg_to'], $aData['app_msg_body'], $aData['app_msg_date'], $aData['app_msg_cc'], $aData['app_msg_bcc'], $aData['app_msg_template']);
|
$this->setData($sUID, $aData['app_msg_subject'], $aData['app_msg_from'], $aData['app_msg_to'], $aData['app_msg_body'], $aData['app_msg_date'], $aData['app_msg_cc'], $aData['app_msg_bcc'], $aData['app_msg_template'], $aData['app_msg_attach']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,7 +154,7 @@ class spoolRun {
|
|||||||
* @param string $sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate, $sCC, $sBCC, $sTemplate
|
* @param string $sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate, $sCC, $sBCC, $sTemplate
|
||||||
* @return none
|
* @return none
|
||||||
*/
|
*/
|
||||||
public function setData($sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate = '', $sCC = '', $sBCC = '', $sTemplate = '') {
|
public function setData($sAppMsgUid, $sSubject, $sFrom, $sTo, $sBody, $sDate = '', $sCC = '', $sBCC = '', $sTemplate = '', $sAttachment = '') {
|
||||||
$this->spool_id = $sAppMsgUid;
|
$this->spool_id = $sAppMsgUid;
|
||||||
$this->fileData['subject'] = $sSubject;
|
$this->fileData['subject'] = $sSubject;
|
||||||
$this->fileData['from'] = $sFrom;
|
$this->fileData['from'] = $sFrom;
|
||||||
@@ -164,7 +164,7 @@ class spoolRun {
|
|||||||
$this->fileData['cc'] = $sCC;
|
$this->fileData['cc'] = $sCC;
|
||||||
$this->fileData['bcc'] = $sBCC;
|
$this->fileData['bcc'] = $sBCC;
|
||||||
$this->fileData['template'] = $sTemplate;
|
$this->fileData['template'] = $sTemplate;
|
||||||
$this->fileData['attachments'] = array ();
|
$this->fileData['attachments'] = ($sAttachment)? $sAttachment:array();
|
||||||
|
|
||||||
if( $this->config['MESS_ENGINE'] == 'OPENMAIL' ) {
|
if( $this->config['MESS_ENGINE'] == 'OPENMAIL' ) {
|
||||||
if( $this->config['MESS_SERVER'] != '' ) {
|
if( $this->config['MESS_SERVER'] != '' ) {
|
||||||
@@ -332,7 +332,8 @@ class spoolRun {
|
|||||||
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
|
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
|
||||||
$oPHPMailer->Subject = utf8_decode($this->fileData['subject']);
|
$oPHPMailer->Subject = utf8_decode($this->fileData['subject']);
|
||||||
$oPHPMailer->Body = utf8_decode($this->fileData['body']);
|
$oPHPMailer->Body = utf8_decode($this->fileData['body']);
|
||||||
|
if($this->fileData['attachments'])
|
||||||
|
$oPHPMailer->AddAttachment($this->fileData['attachments']);
|
||||||
foreach( $this->fileData['envelope_to'] as $sEmail ) {
|
foreach( $this->fileData['envelope_to'] as $sEmail ) {
|
||||||
if( strpos($sEmail, '<') !== false ) {
|
if( strpos($sEmail, '<') !== false ) {
|
||||||
preg_match($this->longMailEreg, $sEmail, $matches);
|
preg_match($this->longMailEreg, $sEmail, $matches);
|
||||||
@@ -375,7 +376,8 @@ class spoolRun {
|
|||||||
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
|
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
|
||||||
$oPHPMailer->Subject = utf8_decode($this->fileData['subject']);
|
$oPHPMailer->Subject = utf8_decode($this->fileData['subject']);
|
||||||
$oPHPMailer->Body = utf8_decode($this->fileData['body']);
|
$oPHPMailer->Body = utf8_decode($this->fileData['body']);
|
||||||
|
if($this->fileData['attachments'])
|
||||||
|
$oPHPMailer->AddAttachment($this->fileData['attachments']);
|
||||||
foreach( $this->fileData['envelope_to'] as $sEmail ) {
|
foreach( $this->fileData['envelope_to'] as $sEmail ) {
|
||||||
$evalMail = strpos($sEmail, '<');
|
$evalMail = strpos($sEmail, '<');
|
||||||
|
|
||||||
|
|||||||
@@ -596,7 +596,7 @@ class wsBase
|
|||||||
* @param $appFields = null
|
* @param $appFields = null
|
||||||
* @return $result will return an object
|
* @return $result will return an object
|
||||||
*/
|
*/
|
||||||
public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null ) {
|
public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $sAttachment ) {
|
||||||
try {
|
try {
|
||||||
$aSetup = getEmailConfiguration();
|
$aSetup = getEmailConfiguration();
|
||||||
|
|
||||||
@@ -671,11 +671,10 @@ class wsBase
|
|||||||
'app_msg_body' => $sBody,
|
'app_msg_body' => $sBody,
|
||||||
'app_msg_cc' => $sCc,
|
'app_msg_cc' => $sCc,
|
||||||
'app_msg_bcc' => $sBcc,
|
'app_msg_bcc' => $sBcc,
|
||||||
'app_msg_attach' => '',
|
'app_msg_attach' => $sAttachment,
|
||||||
'app_msg_template' => '',
|
'app_msg_template' => '',
|
||||||
'app_msg_status' => 'pending'
|
'app_msg_status' => 'pending'
|
||||||
);
|
);
|
||||||
|
|
||||||
$oSpool->create( $messageArray );
|
$oSpool->create( $messageArray );
|
||||||
$oSpool->sendMail();
|
$oSpool->sendMail();
|
||||||
|
|
||||||
@@ -691,7 +690,6 @@ class wsBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get case information
|
* get case information
|
||||||
* @param string $caseId
|
* @param string $caseId
|
||||||
|
|||||||
Reference in New Issue
Block a user