Class: SmsOnRails::ServiceProviders::EmailGateway

Inherits:
Base
  • Object
show all
Defined in:
lib/sms_on_rails/service_providers/email_gateway.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#deliver, get_service_provider, human_name, max_characters, name, provider_by_id, provider_by_name, provider_list, provider_map, #send_sms, #send_to_phone, set_default_service_provider

Class Method Details

.mailer_klassObject

The mailer class to use that can be specified in the config options for :mailer_klass



63
64
65
# File 'lib/sms_on_rails/service_providers/email_gateway.rb', line 63

def mailer_klass#:nodoc:
  @mailer_klass ||= config[:mailer_klass]||SmsOnRails::ServiceProviders::EmailGatewaySupport::SmsMailer
end

Instance Method Details

#mailer_klassObject



13
# File 'lib/sms_on_rails/service_providers/email_gateway.rb', line 13

def mailer_klass; self.class.mailer_klass; end

#pingObject



11
# File 'lib/sms_on_rails/service_providers/email_gateway.rb', line 11

def ping; true; end

#requires_carrier?Boolean

Returns:

  • (Boolean)


15
# File 'lib/sms_on_rails/service_providers/email_gateway.rb', line 15

def requires_carrier?; true; end

#send_message(phone_text, message, options = {}) ⇒ Object

Email Gateway Send message

send_message('[email protected]', 'My message')
send_message('12065551234', 'my message', :carrier => 'Verizon')
send_message(['12065551234', '4125556667'], 'my message', :carrier => 'Verizon')

Params

Options

  • :sender - email address of the sender overrides default

  • :bcc - email_address or array of email_addresses to blind carbon copy



32
33
34
35
# File 'lib/sms_on_rails/service_providers/email_gateway.rb', line 32

def send_message(phone_text, message, options={})
  mailer_klass.deliver_sms_through_gateway(phone_text, message, self.class.config.merge(options))
  {}
end