sending eMail via OTRS' GenericInterface (SOAP and PHP)

English! place to talk about development, programming and coding
Post Reply
lgW
Znuny newbie
Posts: 1
Joined: 23 Jul 2013, 18:28
Znuny Version: 3.2.8

sending eMail via OTRS' GenericInterface (SOAP and PHP)

Post by lgW »

Hello!

I use the OTRS GenericInterface to create a Ticket and the corresponding Articles. The source code example below works fine after setting a Webservice

Code: Select all

$url= "http://192.168..../otrs/nph-genericinterface.pl/Webservice/GenericTicketConnector";

$title    = "My Test Ticket via SOAP and PHP";
$from     = "me@myemail.com";
$NameSpace = 'http://www.otrs.org/TicketConnector/';

$client = new SoapClient(null, array('location'  =>$url,
                                     'uri'       => "Core",
                                     'trace'     => 1,
                                     'style'     => SOAP_RPC,
                                     'use'       => SOAP_ENCODED));


$msg=array(
    
    new SoapParam('root@localhost', 'ns1:UserLogin'),
       
    new SoapParam('xxx', 'ns1:Password'),
    
    new SoapParam(Array(
            'To' => 'xxxxx',
            'CustomerUser'=> 'xxxxx',
            'PriorityID' => '2',
            'Queue' => 'SERVICE',
            'State' => 'new',
            'Title' => 'some title',
    ), 'ns1:Ticket'),
    
    new SoapParam(Array(
            'ArticleType' => 'email-external',
            'To' => 'xxxx',
            'Body' => 'some body',
            'ContentType' => 'text/plain; charset=utf8',
            'Subject' => 'some subject',
            'TimeUnit' => '3',
            'TimeUnits' => 'minutes'
    ), 'ns1:Article')
        
);


$answer = $client->__soapCall('TicketCreate',$msg);

print_r($answer);

Now I'm trying not only to create a Ticket, but also to send an anrticle eMail to the customer as in the otrs/rpc.pl API ArticleSend() method.

Is this possible applying to the GenericInterface TicketCreate controller?

I searched for a similar post but the only discussion i found is viewtopic.php?t=12168

Thanks in advance.

Best regars
Leo
Post Reply