Files
aperonight/app/mailers/ticket_mailer.rb
kbe 4e2445198f feat: Implement complete event ticketing system with Stripe integration and email confirmations
- Enhanced events index page with improved visual design and better information display
- Completely redesigned event show page with modern layout, ticket selection, and checkout functionality
- Implemented Stripe payment processing for ticket purchases
- Created ticket generation system with PDF tickets and QR codes
- Added email confirmation system with ticket attachments
- Updated database configuration to use SQLite for easier development setup
- Fixed gem dependencies and resolved conflicts
- Improved error handling throughout the checkout process
- Enhanced Stimulus controller for ticket cart management
- Added proper redirect handling for successful and cancelled payments
2025-08-28 18:08:05 +02:00

21 lines
510 B
Ruby
Executable File

class TicketMailer < ApplicationMailer
default from: 'notifications@aperonight.com'
def purchase_confirmation(ticket)
@ticket = ticket
@user = ticket.user
@event = ticket.event
# Generate PDF attachment
pdf = @ticket.to_pdf
attachments["ticket-#{@event.name.parameterize}-#{@ticket.qr_code[0..7]}.pdf"] = {
mime_type: 'application/pdf',
content: pdf
}
mail(
to: @user.email,
subject: "Confirmation d'achat - #{@event.name}"
)
end
end