foodsoft/plugins/automatic_invoices/app/overrides/mailers/mailer_override.rb

16 lines
618 B
Ruby
Raw Normal View History

2023-10-10 23:11:34 +02:00
if FoodsoftAutomaticInvoices.enabled?
Mailer.class_eval do
# Sends automatically generated invoicesfor group orders to ordergroup members
def group_order_invoice(group_order_invoice, user)
@user = user
@group_order_invoice = group_order_invoice
@group_order = group_order_invoice.group_order
@supplier = @group_order.order.supplier.name
@group = @group_order.ordergroup
add_group_order_invoice_attachments(group_order_invoice)
mail to: user,
subject: I18n.t('mailer.group_order_invoice.subject', group: @group.name, supplier: @supplier)
end
end
end