Commit d073c3550d8fd1a80703340735290877f8718055

Authored by unknown
1 parent 79c38dcb

Added check for error return from KTAPIDocument email function so that the clien…

…t tools webservices indicate an error to the client tools instead of just assuming success.

KTS-4406. KT Email plugin is not enabled by default & no error returned by webservice on attempting to use KT Email plugin

Committed by: Paul Barrett

Reviewed by: Martin Kirsten
webservice/clienttools/services/3.6.1/kt.php
@@ -982,7 +982,11 @@ class kt extends client_service { @@ -982,7 +982,11 @@ class kt extends client_service {
982 $this->setResponse(array('status'=>'norecipients')); 982 $this->setResponse(array('status'=>'norecipients'));
983 return false; 983 return false;
984 }else{ 984 }else{
985 - $document->email($recipientsList, $message, TRUE); // true to attach document 985 + $result = $document->email($recipientsList, $message, TRUE); // true to attach document
  986 + if (PEAR::isError($result)) {
  987 + $this->setResponse(array('status'=>$result->getMessage()));;
  988 + return false;
  989 + }
986 $this->setResponse(array('status'=>'documentemailed')); 990 $this->setResponse(array('status'=>'documentemailed'));
987 } 991 }
988 return true; 992 return true;