Skip to content

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬

1.6 KB
Raw Blame
<p><%= I18n.t('conversations.reply.greeting', name: @contact.name) %></p>

<p><%= I18n.t('conversations.reply.new_messages') %></p>

<% @messages.each do |message| %>
  <tr>
    <td>
      <b><%= message.incoming? ? I18n.t('conversations.reply.contact_label') : message.sender&.available_name || message.sender&.name || I18n.t('conversations.reply.bot_label') %></b>
    </td>
  </tr>
  <tr>
    <td style="padding: 0px 16px; margin: 4px 0 8px 0; background: #F5FAFF; border-radius: 5px; display: inline-block; font-family: 'Helvetica Neue',Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;">
      <% if (message.content_type == 'input_csat' && message.message_type == 'template') %>
        <p><%= t('conversations.reply.rate_conversation_html', link: link_to(t('conversations.reply.rate_conversation_link'), message.conversation.csat_survey_link, target: '_blank')) %></p>
      <% elsif message.content.present? %>
        <%= ChatwootMarkdownRenderer.new(message.content).render_message %>
      <% end %>
      <% if message.attachments.count.positive? %>
        <p>
          <% if message.content.present? %>
            <hr style="border: 0; border-bottom: 1px solid #AEC3D5;"/>
          <% end %>
          <%= I18n.t('conversations.reply.attachments') %>
          <% message.attachments.each_with_index do |attachment, index| %>
            <% if index > 0 %><br /><% end %>
            <a href="<%= attachment.file_url %>" target="_blank"><%= attachment.file.filename.to_s %></a>
          <% end %>
        </p>
      <% end %>
    </td>
  </tr>
<% end %>