OTRS:通过 Web 服务创建外发电子邮件票
OTRS : Create Outgoing E-Mail-Ticket via Webservice
我正在尝试通过 PHP 和来自 OTRS (https://doc.otrs.com/doc/manual/admin/6.0/en/html/genericinterface.html#id-1.6.12.10.7.2) 的 REST 通用接口创建工单。
我可以创建工单和文章。但 OTRS 历史记录看起来不像是外发电子邮件,而是用户正在向队列发送票证。而且也没有邮件发送给客户:-(。
但我喜欢有一个传出的电子邮件票以及票的待处理状态。
这是我的 PHP 代码
<?php
header("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();
}
https://forums.otterhub.org/viewtopic.php?p=168025#p168025 solved my problem. You need a extra plugin (https://github.com/znuny/Znuny4OTRS-GIArticleSend) 以便能够发送外发电子邮件票证。
我正在尝试通过 PHP 和来自 OTRS (https://doc.otrs.com/doc/manual/admin/6.0/en/html/genericinterface.html#id-1.6.12.10.7.2) 的 REST 通用接口创建工单。
我可以创建工单和文章。但 OTRS 历史记录看起来不像是外发电子邮件,而是用户正在向队列发送票证。而且也没有邮件发送给客户:-(。 但我喜欢有一个传出的电子邮件票以及票的待处理状态。
这是我的 PHP 代码
<?php
header("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();
}
https://forums.otterhub.org/viewtopic.php?p=168025#p168025 solved my problem. You need a extra plugin (https://github.com/znuny/Znuny4OTRS-GIArticleSend) 以便能够发送外发电子邮件票证。