From 50c66e2e0221b84aade66cb7aec5a5cb619b2d89 Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Fri, 4 Aug 2017 04:01:42 -0500 Subject: [PATCH] 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. --- app/mailers/mailbot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/mailbot.rb b/app/mailers/mailbot.rb index f5b7f375..837e2c1e 100644 --- a/app/mailers/mailbot.rb +++ b/app/mailers/mailbot.rb @@ -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,