Class: Nuntius::TwilioSmsProvider
- Inherits:
-
BaseProvider
- Object
- BaseProvider
- Nuntius::TwilioSmsProvider
- Defined in:
- app/providers/nuntius/twilio_sms_provider.rb
Overview
Send SMS messages using twilio.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
17 18 19 20 21 22 |
# File 'app/providers/nuntius/twilio_sms_provider.rb', line 17 def deliver response = client..create(from: .from.present? ? .from : from, to: .to, body: .text) .provider_id = response.sid .status = translated_status(response.status) end |
#refresh ⇒ Object
24 25 26 27 28 29 |
# File 'app/providers/nuntius/twilio_sms_provider.rb', line 24 def refresh response = client.(.provider_id).fetch .provider_id = response.sid .status = translated_status(response.status) end |