Class: Outbox::Messages::SMS

Inherits:
Base
  • Object
show all
Defined in:
lib/outbox/messages/sms.rb

Overview

SMS tend to support very different types of parameters, so only the most common ones will be directly applied to the SMS message class. All of the other ones can be set using the arbitrary field access with

and []=.

sms = Outbox::Messages::SMS.new do
  to '+14155551212'
  from 'Company Name'
  body 'Hellow world'
end
sms.client :twilio, api_key: '...'
sms.deliver

Instance Method Summary collapse

Methods inherited from Base

#body=, #deliver, #initialize

Methods included from Outbox::MessageFields

#[], #[]=, #fields, #fields=, included, #validate_fields

Methods included from Outbox::MessageClients

#client, included

Constructor Details

This class inherits a constructor from Outbox::Messages::Base

Instance Method Details

#audience=(audience) ⇒ Object

:nodoc:



18
19
20
21
22
23
24
25
26
# File 'lib/outbox/messages/sms.rb', line 18

def audience=(audience) # :nodoc:
  case audience
  when String
    self.to = audience
  else
    audience = Outbox::Accessor.new(audience)
    self.to = audience[:to]
  end
end