osTicket/osTicket-1.8 — pull request #416 by rsaccani (2014-01-15 17:26:21+00:00)
Title: Added initial support for parsing form variables in email body

I have added support for parsing dynamic form variables defined in the email body.
Here is how it works:
- The variables can be defined in the email body in the form =. Example: topicId=12
- If the variable topicId is not defined no parsing is done (no topic, no dynamic form)
- Except for topicId, only variables defined by the user in the dynamic form associated to the topic can be defined in email body

I know that this is implementation is far from being elegant but this is my first approach to osTicket and I wanted to contain the patch to class.mailfetch.php in order to be able to start using the feature as soon as poosible.

Please provide suggestions on how to improve this feature.

The main issue I faced is that FormField::getSource returns $_POST allowing such form variables to be defined only via HTTP POST.
To work-around such limitation I pre-populate field->_clean values before saving the form.