<% if !@user.anonymous? %>
Hi <%= @user.first_name %>,
<% end %>

The following musicians have joined JamKazam within the last week and have low internet latency to you that will support enjoyable sessions. If you'd like to make more musical connections, we encourage you to use the links below to send these new users a welcome message and perhaps arrange a session to play together.

<% 
    @musicians_data.each do | data | -%>
     <%
      musicians = data[:musicians]
      latencies = data[:latencies]
      musicians.each do |musician|
        latency = latencies.find{|l| l[:user_id] == musician.id }
    -%>
        <%= musician.first_name %> <%= musician.last_name %>
        Latency To You: <%= latency_info(latency) %>
        <% if musician.last_active_timestamp -%>
          Last Active On: <%= time_ago_in_words(Time.at(musician.last_active_timestamp)) %> ago
        <% end -%>
        <% musician.musician_instruments.each do |mi| -%>
           <%= mi.description %> (<%= @instrument_proficiencies[mi.proficiency_level.to_s.to_sym] %>)
        <% end -%>
        View Profile: <%= APP_CONFIG.spa_origin -%>/friends?id=<%= musician.id %>&open=details
        Send Message: <%= APP_CONFIG.spa_origin -%>/friends?id=<%= musician.id %>&open=message
        Send Friend Request: <%= APP_CONFIG.spa_origin -%>/friends?id=<%= musician.id %>&open=connect

    <% end -%>   
  <% end -%>

  To find great musical matches across the entire JamKazam commiunity and make new connections, use the link below to access our musician search feature. This let you filter JamKazammers by latency, instruments, skill level, genre interests, last active day and more.

  Search JamKazam Musicians: <%= APP_CONFIG.spa_origin -%>/friends