dabystru Posted June 1, 2012 Share Posted June 1, 2012 When opening new ticket from admin area to a non-registered client, the client also gets an e-mail. When doing the same via API:Open Ticket function, I see the new ticket appearing in admin area, but there is no e-mail in client's inbox. Anything I can do to make WHMCS to send e-mails when new tickets are opened by API:Open Ticket function? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted June 1, 2012 Share Posted June 1, 2012 How exactly are you using the API to open tickets with non-registered clients? The API doesnt have input for an email address. http://docs.whmcs.com/API:Open_Ticket The function emails the client properly when entered a userid. 0 Quote Link to comment Share on other sites More sharing options...
dabystru Posted June 2, 2012 Author Share Posted June 2, 2012 On the same page you referred to it says how to open tickets to non-registered clients: name - only required if not a registered client (clientid must be sent as 0) email - only required if not a registered client Should I create a client with API:Add_Client first and then open a ticket in order to send an e-mail to that client? This behaviour is different from opening a ticket to non-registered clients from admin area. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted June 2, 2012 Share Posted June 2, 2012 Ah, you're right. I believe I tested this before and it wasn't working either. For the time being, you might want to pass them through add client first, as you mentioned. I'm fairly certain it does work with existing clients. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted June 2, 2012 Share Posted June 2, 2012 Oh, one other thing, make sure you're sending a zero string for the client ID, and not a zero integer, which may be interpreted as the boolean false instead. $postfields['clientid'] = '0'; 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted June 2, 2012 Share Posted June 2, 2012 (edited) Oh, one other thing, make sure you're sending a zero string for the client ID, and not a zero integer, which may be interpreted as the boolean false instead. $postfields['clientid'] = '0'; To clarify. $postfields['clientid'] = '0'; // string $postfields['clientid'] = 0; // integer $postfields['clientid'] = 'false'; // string $postfields['clientid'] = false; // boolean as stated, an integer 0 could be construed as boolean false, depends on how its checked. == or === the second of the two checks the type also. Edited June 2, 2012 by disgruntled 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted June 2, 2012 Share Posted June 2, 2012 as stated, an integer 0 could be construed as boolean false, depends on how its checked. == or === the second of the two checks the type also. I find it very rare that people go through the trouble of using === when testing integer values.. More often than not, its something like: if ($somevar) { foo(); } Which will evaluate as false if $somevar = 0. 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.