For some reason the the Autoemail option in the API wasn't working for me correctly. It didnt matter if i put TRUE or FALSE as the parameter for SendAuto, it still sent the email. I delved into the code behind it and found this line which toggles whether to send an Autoemail or not.
CODE
$ticketIdData = @createTicket(POST_CLIENT, 0, $userId, $fullName, $email, $subject, $message, '0', $priorityId, $_SWIFT['tgroup']['ticketstatusid'], $departmentId, 0, $_SWIFT['language']['charset'], '', $_SWIFT['tgroup']['tgroupid'], false, $attachments, ($sendAuto?'true':'false'));
I thought that in-line if statement about the $sendAuto variable looked weird so I broke it out as its own seperate if statement
CODE
if($sendAuto):
$sendAuto = true;
else:
$sendAuto = false;
endif;
$ticketIdData = @createTicket(POST_CLIENT, 0, $userId, $fullName, $email, $subject, $message, '0', $priorityId, $_SWIFT['tgroup']['ticketstatusid'], $departmentId, 0, $_SWIFT['language']['charset'], '', $_SWIFT['tgroup']['tgroupid'], false, $attachments, $sendAuto);
$sendAuto = true;
else:
$sendAuto = false;
endif;
$ticketIdData = @createTicket(POST_CLIENT, 0, $userId, $fullName, $email, $subject, $message, '0', $priorityId, $_SWIFT['tgroup']['ticketstatusid'], $departmentId, 0, $_SWIFT['language']['charset'], '', $_SWIFT['tgroup']['tgroupid'], false, $attachments, $sendAuto);
and its now working for me
I dont know if its a problem with my PHP environment or what, but if its happening to me it could be happening to others so I thought i'd give you a heads up.
Thanks,
Dylan.
Sign In »
Register Now!
Help

Back to top








