src/Controllers/AccountTicketController.php
public function postReply(Ticket $ticket, $replyText, $author, $authorEmail)
    {
        if (filter_var($authorEmail, FILTER_VALIDATE_EMAIL) === false)
        {
            throw new InvalidArgumentException($authorEmail . " is not a valid email address.");
        }

        try {
            $this->httpHelper->patch("/tickets/{$ticket->getTicketID()}",[
                'open' => true,
            ]);
        }
        catch (Exception $e)
        {
            //
        }

        return $this->httpHelper->post("/tickets/{$ticket->getTicketID()}/ticket_replies",[
            'text' => $replyText,
            'incoming' => true,
            'author' => $author,
            'author_email' => $authorEmail,
        ]);
    }
public function postReply(Ticket $ticket, $replyText, $author, $authorEmail)
    {
        if (filter_var($authorEmail, FILTER_VALIDATE_EMAIL) === false)
        {
            throw new InvalidArgumentException($authorEmail . " is not a valid email address.");
        }

        try {
            $this->httpHelper->patch("/tickets/{$ticket->getTicketID()}",[
                'open' => true,
            ]);
        }
        catch (Exception $e)
        {
            //
        }

        return $this->httpHelper->post("/tickets/{$ticket->getTicketID()}/ticket_replies",[
            'text' => $replyText,
            'incoming' => true,
            'author' => $author,
            'author_email' => $authorEmail,
        ]);
    }
public function postReply ( Ticket $ ticket , $ replyText , $ author , $ authorEmail ) { if ( filter_var ( $ authorEmail , FILTER_VALIDATE_EMAIL ) === false ) { throw new InvalidArgumentException ( $ authorEmail . " is not a valid email address." ) ; } try { $ this -> httpHelper -> patch ( "/tickets/{$ticket->getTicketID()}" , [ 'open' => true , ] ) ; } catch ( Exception $ e ) { // } return $ this -> httpHelper -> post ( "/tickets/{$ticket->getTicketID()}/ticket_replies" , [ 'text' => $ replyText , 'incoming' => true , 'author' => $ author , 'author_email' => $ authorEmail , ] ) ; }
Post a reply to an existing ticket
@param Ticket $ticket
@param $replyText
@param $author
@param $authorEmail
@return mixed
@throws \SonarSoftware\CustomerPortalFramework\Exceptions\ApiException
Post a reply to an existing ticket