def sms(options = {})
      return @_message if @_sms_was_called && options.blank?

      m = @_message

      # Call all the procs (if any)
      default_values = {}
      self.class.default.each do |k,v|
        default_values[k] = v.is_a?(Proc) ? instance_eval(&v) : v
      end

      # Handle defaults
      options = options.reverse_merge(default_values)

      # Set configure delivery behavior
      wrap_delivery_behavior!(options.delete(:delivery_method), options.delete(:delivery_method_options))

      # Assign all options except body, template_name, and template_path
      assignable = options.except(:body, :template_name, :template_path)
      assignable.each { |k, v| m[k] = v }

      # Render the templates and blocks
      m.body = response(options)
      @_sms_was_called = true

      m
    end
def sms(options = {})
      return @_message if @_sms_was_called && options.blank?

      m = @_message

      # Call all the procs (if any)
      default_values = {}
      self.class.default.each do |k,v|
        default_values[k] = v.is_a?(Proc) ? instance_eval(&v) : v
      end

      # Handle defaults
      options = options.reverse_merge(default_values)

      # Set configure delivery behavior
      wrap_delivery_behavior!(options.delete(:delivery_method), options.delete(:delivery_method_options))

      # Assign all options except body, template_name, and template_path
      assignable = options.except(:body, :template_name, :template_path)
      assignable.each { |k, v| m[k] = v }

      # Render the templates and blocks
      m.body = response(options)
      @_sms_was_called = true

      m
    end
The main method that creates the message and renders the SMS templates. There are
 two ways to call this method, with a block, or without a block.

 It accepts a headers hash. This hash allows you to specify
 the most used headers in an SMS message, these are:

 * +:to+ - Who the message is destined for, can be a string of addresses, or an array
   of addresses.
 * +:from+ - Who the message is from

 You can set default values for any of the above headers (except +:date+)
 by using the ::default class method:

  class Notifier < SmsCarrier::Base
    default from: '+886987654321'
  end

 If you do not pass a block to the +sms+ method, it will find all
 templates in the view paths using by default the carrier name and the
 method name that it is being called from, it will then create parts for
 each of these templates intelligently, making educated guesses on correct
 content type and sequence, and return a fully prepared <tt>Sms</tt>
 ready to call <tt>:deliver</tt> on to send.

 For example:

   class Notifier < SmsCarrier::Base
     default from: 'no-reply@test.lindsaar.net'

     def welcome
       sms(to: 'mikel@test.lindsaar.net')
     end
   end

 Will look for all templates at "app/views/notifier" with name "welcome".
 If no welcome template exists, it will raise an ActionView::MissingTemplate error.

 However, those can be customized:

   sms(template_path: 'notifications', template_name: 'another')

 And now it will look for all templates at "app/views/notifications" with name "another".

 You can even render plain text directly without using a template:

   sms(to: '+886987654321', body: 'Hello Mikel!')