This is a follow up to my previous post on adding phone extension to people results page (PeopleResults.aspx).

This post provides steps on how I added e-mail with action (mailto) to people search.

WorkEmail is one of the default user profile properties already mapped in SharePoint both in User Profile Property and in Search Schema. This makes my job a bit easier because all I have to do is modify my Display Template to include this value.  Some of the steps listed here are the same as my previous post.  I hope this makes things easier than flipping back and forth between the two.

  1. If you already have a custom display template for Item_Person, skip to step 6.  If this is the first time you need to edit the display template for people results, continue to the next step.
  2. From Search Center, select the following:
    • Site Settings
    • Master pages and page layouts
    • Display templates
    • Search
  3. Download ‘Item_Person.html’, save it on your local drive with a different name (ex: My_Item_Person.html)
  4. Modify Title. This will be used later when I modify the People Search Core Results Web Part.
  5. <title>My People Item</title>
  6. In <div id=”ContactInfo”>tag, add
                                        if(has_email == true) {
                                            <div id="WorkEmailField">
                                                var encodedWorkEmail = $htmlEncode(ctx.CurrentItem.WorkEmail);
                                                var displayWorkEmail = Srch.U.getSingleHHXMLNodeValue(hhProps, "workemail");
                                                if ($isEmptyString(displayWorkEmail)) { displayWorkEmail = encodedWorkEmail }
                                                <div id="WorkEmailValue" class="ms-srch-ellipsis" title="_#= encodedWorkEmail =#_"><a href="mailto:_#= encodedWorkEmail =#_"> _#= displayWorkEmail =#_ </a></div>

7.  Save My_Item_Person.html, upload it to the Display Template/Search gallery, and publish it

8.  From Search Center, type in a query term (ex: Executive)

9.  From ‘Site Settings’, select ‘Edit Page’

10.  Edit ‘People Search Core Results’ Web Part

11.  Expand ‘Display Templates’, select ‘Use a single template to display items’, select My People Item, then select ‘OK’

12.  Check In and Publish the People Results page (PeopleResults.aspx)

Your results page shoud look similar to the following.  Note that the OOTB results page only displays Name, Title, and Department


Again, these steps may not be the greatest, but they worked for me.