Files
aperonight/app/views/ticket_mailer/event_reminder.html.erb
kbe 8f9795d773 Fix failing tests and improve email template consistency
- Fix onboarding controller test by using consistent application name
- Fix ticket mailer template error by correcting variable reference (@user.first_name)
- Update event reminder template to use configurable app name
- Refactor mailer tests to properly handle multipart email content
- Update test assertions to match actual template content
- Remove duplicate migration for onboarding field
- Add documentation for test fixes and solutions
2025-09-08 12:36:33 +02:00

86 lines
4.9 KiB
Plaintext

<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background-color: #f8f9fa; border-radius: 8px;">
<div style="text-align: center; padding: 20px 0; border-bottom: 1px solid #e9ecef;">
<h1 style="color: #4c1d95; margin: 0; font-size: 28px;"><%= ENV.fetch("APP_NAME", "Aperonight") %></h1>
<p style="color: #6c757d; margin: 10px 0 0;">Rappel d'événement</p>
</div>
<div style="background-color: white; border-radius: 8px; padding: 30px; margin: 20px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
<h2 style="color: #212529; margin-top: 0;">Salut <%= @user.email.split('@').first %> ! 🎉</h2>
<p style="color: #495057; line-height: 1.6; font-size: 18px;">
<% case @days_before %>
<% when 7 %>
Plus qu'une semaine avant <strong><%= @event.name %></strong> !
<% when 1 %>
C'est demain ! <strong><%= @event.name %></strong> a lieu demain.
<% when 0 %>
C'est aujourd'hui ! <strong><%= @event.name %></strong> a lieu aujourd'hui.
<% else %>
Plus que <%= @days_before %> jours avant <strong><%= @event.name %></strong> !
<% end %>
</p>
<div style="background-color: #f8f9fa; border-radius: 6px; padding: 20px; margin: 25px 0;">
<h3 style="color: #4c1d95; margin-top: 0; border-bottom: 1px solid #e9ecef; padding-bottom: 10px;">Détails de l'événement</h3>
<div style="display: flex; justify-content: space-between; margin-bottom: 15px;">
<div>
<p style="margin: 0; color: #6c757d; font-size: 14px;">📅 Date & heure</p>
<p style="margin: 5px 0 0; font-weight: bold; color: #212529; font-size: 16px;"><%= @event.start_time.strftime("%d %B %Y à %H:%M") %></p>
</div>
</div>
<div style="margin-bottom: 15px;">
<p style="margin: 0; color: #6c757d; font-size: 14px;">📍 Lieu</p>
<p style="margin: 5px 0 0; font-weight: bold; color: #212529;"><%= @event.venue_name %></p>
<p style="margin: 5px 0 0; color: #495057;"><%= @event.venue_address %></p>
</div>
</div>
<div style="background-color: #f8f9fa; border-radius: 6px; padding: 20px; margin: 25px 0;">
<h4 style="color: #4c1d95; margin-top: 0; margin-bottom: 15px;">Vos billets pour cet événement :</h4>
<% @tickets.each_with_index do |ticket, index| %>
<div style="border: 1px solid #e9ecef; border-radius: 4px; padding: 15px; margin-bottom: 10px; background-color: white;">
<div style="display: flex; justify-content: space-between; align-items: center;">
<div>
<p style="margin: 0 0 5px; font-weight: bold; color: #212529;">🎫 Billet #<%= index + 1 %></p>
<p style="margin: 0; color: #6c757d; font-size: 14px;"><%= ticket.ticket_type.name %></p>
<p style="margin: 5px 0 0;"><a href="<%= ticket_url(ticket) %>" style="color: #4c1d95; text-decoration: none; font-size: 14px;">📱 Voir le détail et le code QR</a></p>
</div>
<div style="text-align: right;">
<span style="background-color: #d4edda; color: #155724; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold;">ACTIF</span>
</div>
</div>
</div>
<% end %>
</div>
<div style="text-align: center; margin: 30px 0;">
<% if @days_before == 0 %>
<p style="color: #495057; margin-bottom: 20px; font-size: 16px;">🚨 N'oubliez pas vos billets ! Ils ont été envoyés par email lors de votre achat.</p>
<% else %>
<p style="color: #495057; margin-bottom: 20px;">📧 Vos billets ont été envoyés par email lors de votre achat.</p>
<% end %>
<p style="color: #495057; margin-bottom: 20px;">Présentez-les à l'entrée de l'événement pour y accéder.</p>
</div>
<% if @days_before <= 1 %>
<div style="background-color: #d1ecf1; border-radius: 6px; padding: 15px; border-left: 4px solid #17a2b8; margin: 20px 0;">
<p style="margin: 0; color: #0c5460; font-size: 14px;">
<strong>💡 Conseil :</strong> Arrivez un peu en avance pour éviter les files d'attente à l'entrée !
</p>
</div>
<% else %>
<div style="background-color: #d4edda; border-radius: 6px; padding: 15px; border-left: 4px solid #28a745;">
<p style="margin: 0; color: #155724; font-size: 14px;">
<strong>📅 Ajoutez à votre calendrier :</strong> N'oubliez pas d'ajouter cet événement à votre calendrier pour ne pas le manquer !
</p>
</div>
<% end %>
</div>
<div style="text-align: center; color: #6c757d; font-size: 14px; padding: 20px 0;">
<p style="margin: 0;">Des questions ? Contactez-nous à <a href="mailto:support@aperonight.com" style="color: #4c1d95; text-decoration: none;">support@aperonight.com</a></p>
<p style="margin: 10px 0 0;">&copy; <%= Time.current.year %> ApéroNight. Tous droits réservés.</p>
</div>
</div>