manager: fix SendInBlue emails

This commit is contained in:
Pierre de La Morinerie 2021-04-08 17:13:39 +02:00
parent eb8d5b711f
commit 76e74003ad
5 changed files with 60 additions and 28 deletions

View file

@ -18,9 +18,9 @@
<section class="main-content__body">
<h2>Historique des email</h2>
<% if @transactionnal_emails.present? %>
<% if @sent_mails.present? %>
<p>
Cet historique contient les 30 derniers jours. Pour un recherche plus fine, il faut <a href="https://app-smtp.sendinblue.com/log">fouiller les logs</a>.
Cet historique contient les 30 derniers jours. Pour un recherche plus fine, il faut fouiller les <a href="https://app-smtp.sendinblue.com/log">logs de SendInblue</a> ou de Mailjet.
</p>
<table>
<thead>
@ -29,41 +29,44 @@
Émetteur
</th>
<th class="cell-label cell-label--string cell-label--false" scope="col" role="columnheader" aria-sort="none">
Sujet
Objet
</th>
<th class="cell-label cell-label--string cell-label--false" scope="col" role="columnheader" aria-sort="none">
Date
</th>
<th class="cell-label cell-label--string cell-label--false" scope="col" role="columnheader" aria-sort="none">
Statut
</th>
<th class="cell-label cell-label--string cell-label--false" scope="col" role="columnheader" aria-sort="none">
Prestataire
</th>
</tr>
</thead>
<tbody>
<% @transactionnal_emails&.transactional_emails&.reverse&.each do |email| %>
<% matching_events = @events&.events&.select { |e| e.message_id == email.message_id } %>
<tr class="<%= event_color_code(matching_events) %>">
<% @sent_mails.each do |email| %>
<tr class="<%= status_color_code(email.status) %>">
<td class="cell-data cell-data--string" style="">
<%= email.from %>
</td>
<td class="cell-data cell-data--string" style="">
<%= email.subject %>
<%= email.subject %>
</td>
<td class="cell-data cell-data--string" style="text-align: center;">
<%= l(email.date.is_a?(String) ? Time.zone.parse(email.date) : email.date, format: '%d/%m/%y à %H:%M') %>
<%= l(email.delivered_at, format: :long) %>
</td>
<td class="cell-data cell-data--string" style="text-align: center;">
<ul>
<% matching_events.each do |event|%>
<li><%= event.event %></li>
<% end %>
</ul>
<%= email.status %>
</td>
<td class="cell-data cell-data--string" style="">
<%= link_to email.service_name, email.external_url, style: 'text-decoration: underline' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>Historique indisponible. Cet email n'existe pas chez Sendinblue, ou nous n'avons pas réussi à échanger.
Vous pouvez éventuellement <a href="https://app-smtp.sendinblue.com/log">fouiller leurs logs</a>.</p>
<p>Historique indisponible. Cette adresse email n'existe pas chez nos prestataires d'envoi, ou nous n'avons pas réussi à en charger des données.
Vous pouvez éventuellement fouiller les <a href="https://app-smtp.sendinblue.com/log">logs de SendInBlue</a> ou de Mailjet.</p>
<% end %>
<h2>Problèmes potentiel</h2>