Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
568 B
Ruby
22 lines
568 B
Ruby
module Billing
|
|
class InvoiceMailer < ApplicationMailer
|
|
def invoice_pdf
|
|
@invoice = params[:invoice]
|
|
@club = @invoice.club
|
|
|
|
I18n.with_locale(I18n.locale) do
|
|
prefix = t("mailers.invoice.attachment_prefix")
|
|
attachments["#{prefix}-#{@invoice.number.parameterize}.pdf"] = {
|
|
mime_type: "application/pdf",
|
|
content: @invoice.pdf.download
|
|
}
|
|
|
|
mail(
|
|
to: @club.billing_email,
|
|
subject: t("mailers.invoice.subject", number: @invoice.display_number)
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|