There is a check missing if body and subject are already available. As it is, the code will overwrite the values of the agent when he uploads a new file, for example. Try:

```if (!$GetParam{Subject}) { .... overwrite subject with value from config ... }```