Hi,

I have a feedback form where users are sending error reports. It could be helpful to receive the user browser and device information with the email received.

How to add user agent data (like browser version and device name) to the email received from webform?
Should this be done using PHP, tokens, browscap module or webform rules module?
What is the best direction to go with this..

Thanks

Comments

jukka792 created an issue. See original summary.

todea’s picture

I use form_alter in a custom module to populate a hidden field with the useragent string.

function mymodule_form_alter(&$form, $form_state, $form_id) {
	// get useragent for contact us form
	if ($form_id == 'webform_client_form_3207') {
		$form['submitted']['myfield']['#value'] = $_SERVER['HTTP_USER_AGENT'];
	}
}
jacob.embree’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.