Module SmsOnRails::ModelSupport::Draft::ClassMethods
In: lib/sms_on_rails/model_support/draft.rb

Methods

Public Instance methods

Create the draft object options - A Draft object, a hash of attributes(can be nested) or a String with the draft message

Create a new sms draft message - can either be a string, an attribute hash (nested ok) or and ActiveRecord phone_numbers - array or single text phone number or phone number . If message is

  a nested attributes (Rails 2.3), +phone_numbers+ and +options+ should be blank

Options

:send_immediately - Send all outbounds now :draft - a hash of attributes for the draft object :phone_number - a hash of attributes applied to all phone_numbers :outbound - a hash of attributes applied to all generated Outbound instances :keep_failed_outbounds - typically outbound messages are destroyed if they fail during delivery :deliver - options to pass to the deliver method if :send_immediately is used

Example

SmsOnRails::Draft.create_sms(‘my_message’, ‘9995556667’) SmsOnRails::Draft.create_sms(‘my_message’, [‘2065556666’, ‘9995556667’])

SmsOnRails::Draft.create_sms(params[:draft]) # assume nested with :outbound_attributes SmsOnRails::Draft.create_sms(params[:draft], params[:phone_numbers], :send_immediately => true

[Validate]