mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Add paid flag to email subject, check receipt date in tests
This commit is contained in:
parent
82c048b316
commit
235ef9ba3e
5 changed files with 32 additions and 5 deletions
|
@ -1,9 +1,10 @@
|
|||
class InvoiceMailer < ApplicationMailer
|
||||
def invoice_email(invoice:, recipient:)
|
||||
def invoice_email(invoice:, recipient:, paid: false)
|
||||
@invoice = invoice
|
||||
|
||||
subject = default_i18n_subject(invoice_number: invoice.number)
|
||||
subject << I18n.t('invoice.already_paid') if paid
|
||||
attachments["invoice-#{invoice.number}.pdf"] = invoice.as_pdf
|
||||
mail(to: recipient, subject: subject)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue