Class: GovukNotifyRails::Delivery
- Inherits:
-
Object
- Object
- GovukNotifyRails::Delivery
- Defined in:
- lib/govuk_notify_rails/delivery.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
- #deliver!(message) ⇒ Object
-
#initialize(settings) ⇒ Delivery
constructor
A new instance of Delivery.
Constructor Details
#initialize(settings) ⇒ Delivery
Returns a new instance of Delivery.
5 6 7 |
# File 'lib/govuk_notify_rails/delivery.rb', line 5 def initialize(settings) self.settings = settings end |
Instance Attribute Details
#settings ⇒ Object
Returns the value of attribute settings.
3 4 5 |
# File 'lib/govuk_notify_rails/delivery.rb', line 3 def settings @settings end |
Instance Method Details
#deliver!(message) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/govuk_notify_rails/delivery.rb', line 9 def deliver!() payload = payload_for() responses = .to.map do |to| notify_client.send_email( payload.merge(email_address: to) ) end .govuk_notify_responses = responses # For backwards compatibility .govuk_notify_response = responses.first responses end |