Class: Billomat::Actions::Email
- Inherits:
-
Object
- Object
- Billomat::Actions::Email
- Defined in:
- lib/billomat/actions/email.rb
Overview
This actions sends an invoice email. Recipients must be passed like this:
{ recipients: { to: '[email protected]' } }
Instance Method Summary collapse
-
#call ⇒ TrueClass
Calls the gateway.
- #initialize(invoice_id, opts = {}) ⇒ Billomat::Actions::Email constructor
-
#path ⇒ String
The path for the email action.
-
#wrapped_data ⇒ Hash
Wraps the options.
Constructor Details
#initialize(invoice_id, opts = {}) ⇒ Billomat::Actions::Email
15 16 17 18 |
# File 'lib/billomat/actions/email.rb', line 15 def initialize(invoice_id, opts = {}) @invoice_id = invoice_id @opts = opts end |
Instance Method Details
#call ⇒ TrueClass
Calls the gateway.
23 24 25 26 27 |
# File 'lib/billomat/actions/email.rb', line 23 def call Billomat::Gateway.new(:post, path, wrapped_data).run true end |
#path ⇒ String
Returns the path for the email action.
37 38 39 |
# File 'lib/billomat/actions/email.rb', line 37 def path "/invoices/#{@invoice_id}/email" end |
#wrapped_data ⇒ Hash
Wraps the options
32 33 34 |
# File 'lib/billomat/actions/email.rb', line 32 def wrapped_data { email: @opts } end |