Display additional user info from your own portal (eg. logins or e-mail addresses)

Created: 2015-04-23
Last updated: 2016-01-05
Post view count: 2246

In some cases it's useful to know which specific user submitted a particular post, especially if you want to contact them about ticket resolution. You can do this on Sugester using some simple Javascript code.
To add user info add the following code before the Sugester call script:
<script type="text/javascript">var uid = 'user id/login'; var uid_email='user e-mail';</script>
If your site runs using PHP the code could look like this:
<script type="text/javascript">var uid = 'login <?= @user.login ?>'; var uid_email='<?= @user.email ?>';</script> <script src='http://app.sugester.dev/your-account/widget.js' type='text/javascript'></script>
If your site runs on Ruby on Rails the code could look like this:
<script type="text/javascript">var uid = 'login <%= current_user.login %>'; var uid_email='<%= current_user.email%>';</script> <script src='http://app.sugester.dev/your-account/widget.js' type='text/javascript'></script>
This code enables site admins to see user information for every submission. The option is only available to PRO subscribers.


Add Comment