Remitur Posted May 22, 2019 Share Posted May 22, 2019 According to https://developers.whmcs.com/api-reference/openticket/ , it seems that it's possible text formatting using the same syntax available in the ticket web text editor; that's to say, their code sample: $command = 'OpenTicket'; $postData = array( 'deptid' => '1', 'subject' => 'This is a sample ticket', 'message' => 'This is a **sample** ticket message', 'clientid' => '1', 'priority' => 'Medium', 'markdown' => true, 'attachments' => base64_encode(json_encode([['name' => 'sample_text_file.txt', 'data' => base64_encode('This is a sample text file contents')]])), ); $adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later $results = localAPI($command, $postData, $adminUsername); print_r($results); suggests that "sample" should be bold. And, if I insert *sample*, it will be italic, and so on... But (for me) it doesn't work: if I use that syntax, I get exactly the same message, without any text formatting; that's to say, if I specify $textmessage = $textmessage ."\r\n[Text to display](http://www.example.com)"; $textmessage = $textmessage ."\r\n**bold**\r\n*italic*\r\n### Small header\r\n"; the text I will get in the ticket will be: Quote [Text to display](http://www.example.com) **bold** *italic* ### Small header Am I missing something, or is the doc wrong? 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted May 22, 2019 Share Posted May 22, 2019 Using that example code works for me except the attachment doesn't come in. The word "sample" is bold as expected though. What version of WHMCS are you using? 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted May 22, 2019 Author Share Posted May 22, 2019 6 hours ago, steven99 said: What version of WHMCS are you using? Tried on my dev environment with 7.6.1 ... 😮 Will do a try on production environment too (even if I can't imagine what may be the possible reason...) 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted May 22, 2019 Share Posted May 22, 2019 My dev that I tested on is 7.6.1 also. So seems to be something special with your dev setup. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.