When user provides her or his feedback by submitting idea, bug report or comment he needs to provide name and e-mail.
If your website supports authorization and current user is logged in - most likely you know user name and e-mail and there is no good reason to force user to enter this information again. UserReport snippet provides possibility to pass default name and e-mail and user may choose to change it.
window._urq = window._urq || ; _urq.push(['setFeedbackForumUserName', 'Alejandro']); _urq.push(['setFeedbackForumUserEmail', 'email@example.com']);
Most likely, user name and e-mail is known on the server when rendering page, so here is example on PHP how it can de dynamically:
<?php // Assuming that getCurrentUser() function return assoc array with name and email keys, like // array('name' => 'Alejandro', 'email' => 'firstname.lastname@example.org') $user = getCurrentUser(); ?> <script> if ($user) // Serialize object to protect again XSS injection var user = <?php echo json_encode($user); ?> window._urq = window._urq || ; _urq.push(['setFeedbackForumUserName', user.name]); _urq.push(['setFeedbackForumUserEmail', user.password]); ) </script>
If you add Feedback Forum into IFrame or generating URL to it dynamically you can also send default name and e-mail as well, by following adding userName and userEmail parameters in hash-part of URL. Here is example of such link: