【问题标题】:OTRS : Create Outgoing E-Mail-Ticket via WebserviceOTRS:通过 Web 服务创建传出电子邮件票
【发布时间】:2020-04-06 14:23:22
【问题描述】:

我正在尝试通过 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();
    }

【问题讨论】:

  • 你尝试过什么调试问题?
  • 我做了什么:试图找到有效的 PHP 示例(找不到一些)。切换到/从键。尝试不同的 SenderType 和 CommunicationChannels

标签: php rest guzzle otrs


【解决方案1】:

https://forums.otterhub.org/viewtopic.php?p=168025#p168025 解决了我的问题。您需要一个额外的插件 (https://github.com/znuny/Znuny4OTRS-GIArticleSend) 才能发送外发电子邮件票证。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-29
    • 2015-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-16
    • 2020-06-02
    相关资源
    最近更新 更多