Explicitly add .pdf to make it a PDF file.

Some SMTP providers would treat all files w/o suffix as `.txt`s. This patch would make it work in most cases.
This commit is contained in:
Wexpo Lyu 2017-08-04 04:01:42 -05:00 committed by GitHub
parent 80a9544279
commit 50c66e2e02

View file

@ -15,7 +15,7 @@ class Mailbot < ActionMailer::Base
PhysicalTicket.last(ticket_purchase.quantity).each do |physical_ticket|
pdf = TicketPdf.new(@conference, @user, physical_ticket, @conference.ticket_layout.to_sym, "ticket_for_#{@conference.short_title}_#{physical_ticket.id}")
attachments["ticket_for_#{@conference.short_title}_#{physical_ticket.id}"] = pdf.render
attachments["ticket_for_#{@conference.short_title}_#{physical_ticket.id}.pdf"] = pdf.render
end
mail(to: @user.email,