mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 20:27:30 +02:00
- Remove `Que::Mailer` (#895) - Extract controllers - Extract translations - Convert HAML to ERB - Add mailer preview - Improve UI - Remove unused routes - Add tests
26 lines
No EOL
492 B
Ruby
26 lines
No EOL
492 B
Ruby
module Deliverable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_action :find_invoice
|
|
end
|
|
|
|
def new
|
|
authorize! :manage, @invoice
|
|
@recipient = @invoice.buyer.billing_email
|
|
end
|
|
|
|
def create
|
|
authorize! :manage, @invoice
|
|
|
|
InvoiceMailer.invoice_email(invoice: @invoice, recipient: params[:recipient]).deliver_now
|
|
|
|
redirect_to redirect_url, notice: t('.delivered')
|
|
end
|
|
|
|
private
|
|
|
|
def find_invoice
|
|
@invoice = Invoice.find(params[:invoice_id])
|
|
end
|
|
end |