我正在嘗試通過(guò) PHP 和來(lái)自 OTRS 的 REST 通用接口創(chuàng)建票證(https://doc.otrs.com/doc/manual/admin/6.0/en/html/genericinterface.html#id-1.6.12.10.7.2) .我可以創(chuàng)建工單和文章。但 OTRS 歷史記錄看起來(lái)不像是外發(fā)電子郵件,而是用戶正在向隊(duì)列發(fā)送票證。而且也沒(méi)有郵件發(fā)送給客戶:-(。但是我喜歡有一個(gè)外發(fā)的電子郵件票證和票證的待處理狀態(tài)。這是我的 PHP 代碼<?phpheader("Content-type: application/json; charset=utf-8");require __DIR__ . '/vendor/autoload.php';use GuzzleHttp\Client;$client = new Client(['base_uri' => 'http://test-otrs.company.local/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/']);$arrTicket = array( "Title" => 'some ticket title', "Queue" => 'testqueue', "Lock" => 'unlock', "Type" => 'Unclassified', "State" => 'new', "Priority" => '3 normal', "Owner" => 'username', "CustomerUser" => 'user@test.com');$arrArticle = array( "CommunicationChannel" => 'Email', "SenderType" => 'agent', "To" => 'user@test.com', "Subject" => 'some subject', "Body" => 'some body', "ContentType" => 'text/plain; charset=utf8');$response = $client->post('Ticket', ['json' => array("UserLogin" => "username", "Password" => "testtesttest", "Ticket" => $arrTicket, "Article" => $arrArticle)]);if ($response->getBody()) { echo $response->getBody(); }
OTRS:通過(guò) Web 服務(wù)創(chuàng)建外發(fā)電子郵件票
慕田峪7331174
2022-12-11 10:13:24