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

<%= I18n.t 'user_mailer.new_musicians_match.paragraph1' -%>

<% 
    @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 %>
        <%= I18n.t 'user_mailer.new_musicians_match.latency_to_you' -%>: <%= latency_info(latency) %>
        <% if musician.last_active_timestamp -%>
          <%= I18n.t 'user_mailer.new_musicians_match.last_active' -%>: <%= 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 -%>
        <%= I18n.t 'user_mailer.new_musicians_match.view_profile' -%>: <%= APP_CONFIG.spa_origin_url -%>/friends?id=<%= musician.id %>&open=details
        <%= I18n.t 'user_mailer.new_musicians_match.send_message' -%>: <%= APP_CONFIG.spa_origin_url -%>/friends?id=<%= musician.id %>&open=message
        <%= I18n.t 'user_mailer.new_musicians_match.send_friend_request' -%>: <%= APP_CONFIG.spa_origin_url -%>/friends?id=<%= musician.id %>&open=connect

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

  <%= I18n.t 'user_mailer.new_musicians_match.paragraph2' -%>

  <%= I18n.t 'user_mailer.new_musicians_match.search_musicians' -%>: <%= APP_CONFIG.spa_origin_url -%>/friends