Jump to content

API:Open Ticket does not send an e-mail


dabystru

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by disgruntled
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated