Add test emails

This commit is contained in:
Martin Lensment 2015-04-22 13:13:44 +03:00
parent 49be49ea63
commit fc9b8f6ef4

View file

@ -1,5 +1,10 @@
class InvoiceMailer < ApplicationMailer
def invoice_email(invoice, pdf)
unless Rails.env.production?
test_emails = ['martin@gitlab.eu', 'priit@gitlab.eu']
return unless test_emails.include?(invoice.billing_email)
end
attachments[invoice.pdf_name] = pdf
mail(to: invoice.billing_email, subject: invoice)
end