Module: SmsOnRails
- Defined in:
- lib/sms_on_rails/service_providers/base.rb,
app/models/sms_on_rails/draft.rb,
lib/sms_on_rails/schema_helper.rb,
lib/sms_on_rails/util/sms_error.rb,
app/models/sms_on_rails/outbound.rb,
app/models/sms_on_rails/phone_number.rb,
lib/sms_on_rails/model_support/draft.rb,
app/models/sms_on_rails/phone_carrier.rb,
lib/sms_on_rails/model_support/outbound.rb,
lib/sms_on_rails/service_providers/dummy.rb,
lib/sms_on_rails/model_support/phone_number.rb,
lib/sms_on_rails/model_support/phone_carrier.rb,
lib/sms_on_rails/service_providers/clickatell.rb,
lib/sms_on_rails/service_providers/email_gateway.rb,
lib/sms_on_rails/activerecord_extensions/lockable_record.rb,
lib/sms_on_rails/model_support/phone_number_associations.rb,
lib/sms_on_rails/activerecord_extensions/acts_as_deliverable.rb,
lib/sms_on_rails/activerecord_extensions/acts_as_substitutable.rb,
lib/sms_on_rails/service_providers/email_gateway_support/errors.rb,
lib/sms_on_rails/activerecord_extensions/has_a_sms_service_provider.rb,
lib/sms_on_rails/service_providers/email_gateway_support/sms_mailer.rb
Overview
This is the base class for service providers from which all others inherit All service providers are singletons and can be accessed by their instance
To send a message without validation
SmsOnRails::ServiceProviders::<Provider>.instance.send_message '12065551234', 'my message', options
To send a message with validation use send_to_phone_number with a string or SmsOnRails::PhoneNumber instance
SmsOnRails::ServiceProviders<Provider>.instance.send_to_phone_number(number, message, options)
To send an sms(with validation)
SmsOnRails::ServiceProviders<Provider>.instance.send_sms(sms, options)
However, it is preferred to use the locking mechanism to prevent double messages from being sent
sms.deliver!
Defined Under Namespace
Modules: ActsAsDeliverable, ActsAsSubstitutable, CreationSupport, LockableRecord, ModelSupport, PhoneNumbersHelper, ServiceProviders, SmsHelper Classes: Draft, FatalSmsError, Outbound, PhoneCarrier, PhoneNumber, SchemaHelper, SmsError