Class: Nuntius::MessageBirdSmsProvider
- Inherits:
-
BaseProvider
- Object
- BaseProvider
- Nuntius::MessageBirdSmsProvider
- Defined in:
- app/providers/nuntius/message_bird_sms_provider.rb
Overview
Send SMS messages using messagebird.com
Instance Attribute Summary
Attributes inherited from BaseProvider
Instance Method Summary collapse
Methods inherited from BaseProvider
all_settings, #callback, class_from_name, #initialize, #name, setting_reader, states, transport
Constructor Details
This class inherits a constructor from Nuntius::BaseProvider
Instance Method Details
#deliver ⇒ Object
16 17 18 19 20 21 |
# File 'app/providers/nuntius/message_bird_sms_provider.rb', line 16 def deliver response = client.(.from.present? ? .from : from, .to, .text) .provider_id = response.id .status = translated_status(response.recipients["items"].first.status) end |
#refresh ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/providers/nuntius/message_bird_sms_provider.rb', line 23 def refresh response = client.(.provider_id) .provider_id = response.id .status = translated_status(response.recipients["items"].first.status) Nuntius.config.logger.call.info "SMS #{.to} status: #{.status}" rescue => _e end |