Create a snippet named getServer with this code. Note that functions need to be named exactly as the parameter in the eform call will specify, and must end with a return true to allow eForm to continue processing. The snippet itself does not need to be named the same as the function; in fact if you have more than one event you want to use you can have multiple functions in a single snippet, as long as each function fulfills the requirements.
Add the event function to the eform call:
&eformOnBeforeMailSent=`getServer`
You can either put the getServer snippet call before the eForm snippet call (the snippet with the function must appear before the eForm snippet call so that the function is defined in PHP’s memory so it’s available to eForm), or you can use the new &runSnippet parameter with the name of your snippet:
The fields have been added to the $fields array, so their placeholders are now available for use in your report tpl
<strong>IP:</strong> [+remote_addr+]<br />
<strong>Host:</strong> [+remote_host+]<br />
<strong>User Agent:</strong> [+user_agent+]
Note that many servers won’t report their host name, so there probably won’t be any value for that.