is it possible to display our customer email permanently (not only when hoovering over the customer name)

Christophe 's Avatar

Christophe

14 Mar, 2017 03:08 PM

Hi,

in our support team, we often need to know the email address of the customer. the reason is that we may respond differently depending on the customer address. Currently the email address is only visible when hoovering the mouse above the customer name.
We also often need to copy/paste the email address to get some info in our own product backoffice. When answering a discussion this means opening temporary a new page (the user page) copying the email address, closing the temporary page (and then using the user email address in our backoffice...)

Both of these two needs would be easily fulfilled just by always displaying the user email address on the right of the user name (see in the attached image).

Is this possible with a specific CSS? otherwise could you make it possible?

Christophe

  1. Support Staff 1 Posted by Courtenay on 14 Mar, 2017 09:52 PM

    Courtenay's Avatar

    Hey Christophe, I just wrote this javascript for you

    You could put it at the bottom of your custom JS field.
    It adds a textfield and a button, you click the button to just copy the value. Could be improved but I'm still pre-coffee :) You don't really need the text field, it's just for interest.

    
    function copyToClipboard(evt) {
      var aux = document.createElement("input");
      aux.setAttribute("value", evt.target.dataset.userEmail)
      document.body.appendChild(aux);
      aux.select();
      document.execCommand("copy");
      document.body.removeChild(aux);
    }
    meta = jQuery('.meta h4>a:first')
    button = jQuery('<button>').
      attr('data-user-email', meta.attr('data-user-email')).
      text('copy')
    email = jQuery('<input type=text>').
      val(meta.attr('data-user-email'))
    
    email.insertAfter(meta)
    button.insertAfter(email)
    button.click(copyToClipboard)
    
  2. Support Staff 2 Posted by Courtenay on 14 Mar, 2017 09:53 PM

    Courtenay's Avatar

    also if you have a url you can 'post' to your backoffice you could insert a link there pretty easily - or even a form (depends on if your back office allows posting from tender) I can whip up a simple script for this if you need.

  3. 3 Posted by Seb on 15 Mar, 2017 10:03 AM

    Seb 's Avatar

    Hi Courtenay,

    Thanks for your help, we simply display the email on right side using the code bellow.

    But if we want to display it only for logged support staff users (for confidentiality), is the code bellow is ok and enough (I inspected the Tender js object and i've found i can use Tender.user_flags.support)?

    /* display user email on header only for support staff */
    if(Tender.user_flags.support)
    {
    var email = jQuery("div.meta a.user-link").attr("data-user-email");
    jQuery("div.meta > h4").append("<span style='font-weight:400; margin-left:20px;'>"+email+"</span>");
    }
    

    Thanks,
    Regards,
    Seb

  4. Support Staff 4 Posted by Courtenay on 15 Mar, 2017 08:24 PM

    Courtenay's Avatar

    Yes, Tender.user_flags.support is good. I liked the copy button because it's one less click for your staff :) You could also generate a link straight to your own admin page.

  5. Courtenay closed this discussion on 15 Mar, 2017 08:24 PM.

  6. Christophe re-opened this discussion on 16 Mar, 2017 10:10 AM

  7. 5 Posted by Christophe on 16 Mar, 2017 10:10 AM

    Christophe 's Avatar

    Thanks for the confirmation....

    In fact we already had the button. But we also need the copy paste possibility as often we are using several web browsers, so the the direct link to our backoffice is no necessary going to the proper webbrowser...

    Christophe

  8. Christophe closed this discussion on 03 May, 2017 04:33 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac