mirror of
https://github.com/internetee/registry.git
synced 2025-07-14 06:55:11 +02:00
13 lines
368 B
Ruby
13 lines
368 B
Ruby
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
|
|
|
|
@invoice = invoice
|
|
|
|
attachments[invoice.pdf_name] = pdf
|
|
mail(to: invoice.billing_email, subject: invoice)
|
|
end
|
|
end
|