action_smser 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,7 +53,7 @@ class ActionSmser::Base
53
53
 
54
54
  # Called from class.method_missing with own_sms_message when you call OwnMailer.own_sms_message
55
55
  def initialize(method_name = 'no_name_given', *args)
56
- @delivery_options = ActionSmser.delivery_options.dup
56
+ @delivery_options = ActionSmser.delivery_options.deep_dup
57
57
  @valid = true
58
58
  @sms_action = method_name
59
59
  @sms_type = "#{self.class}.#{@sms_action}"
@@ -5,6 +5,7 @@ module ActionSmser::DeliveryMethods
5
5
 
6
6
  # Very simple implementation of http request to gateway. Options used are
7
7
  # server, use_ssl, username, password
8
+ # Also optional code (=unicode) is possible. See https://docs.nexmo.com/index.php/messaging-sms-api/send-message
8
9
  # overwrite deliver_path(sms, options) with your own if you have different type of path
9
10
  class Nexmo < SimpleHttp
10
11
 
@@ -45,7 +46,9 @@ module ActionSmser::DeliveryMethods
45
46
  end
46
47
 
47
48
  def self.deliver_path(sms, to, options)
48
- "/sms/json?username=#{options[:username]}&password=#{options[:password]}&ttl=#{sms.ttl_to_i*1000}&status-report-req=#{options[:status_report_req]}&from=#{sms.from_encoded}&to=#{to}&text=#{sms.body_escaped}"
49
+ path = "/sms/json?username=#{options[:username]}&password=#{options[:password]}&ttl=#{sms.ttl_to_i*1000}&status-report-req=#{options[:status_report_req]}&from=#{sms.from_encoded}&to=#{to}&text=#{sms.body_escaped}"
50
+ path += "&code=#{options[:code]}" if options[:code]
51
+ path
49
52
  end
50
53
 
51
54
  # Callback message status handling
@@ -1,3 +1,3 @@
1
1
  module ActionSmser
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end