osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go
get it now
Parsing form variables and data from email bodies to fill out ticket details automatically.
I recently took over a project from another group, with one of the tasks being to update the current in place osTicket(v1.10) to allow for tickets to be automatically generated upon receiving emails. This part was not so difficult, with the mail fetching already in place. However, I have not been able to populate form variables with data from the email body, it is all currently just dumped into the ticket thread(vars['message']). Has anyone written a block and/or mod that does this and actually works? I have only found one example, and it doesn't work.
Note: The problem is not parsing the email body, the problem seems to lie in either getting the correct form id and/or field names. Also $topic does not seem to be set, but even forcing a value to it doesn't seem to work.
Thank you in advance.
Comments
Note, I am not well versed in Regex so it is good chance just me having won't capture syntax. But I tested it separately in eclipse and it worked perfectly so I dunno.
You're better off starting simple, like: fname=(.+)
But you'd have to change the plugin to work with capture groups.
https://github.com/Micke1101/OSTicket-plugin-Emailform/blob/9421e19c3a92c41b61a1fa10d9dd18a88bcdf43d/class.EmailformPlugin.php#L62
Change the $match[0] to $match[1]
First Name:
John
Last Name:
Doe