turatel_sms 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12d2976471f4dcc29ea9c38d185c59552be28973
4
- data.tar.gz: 0218ab016e89ce1d7c24ca39dded84a65e23b7f8
3
+ metadata.gz: 08a25902698fb14d3ad0c4f607c57c888811b359
4
+ data.tar.gz: e8f4b2eaf09bf51ea363c94cef02ce4e9c5a58c0
5
5
  SHA512:
6
- metadata.gz: 51068fe2f2bb25d967a1e603725368c34e96b79885fc4b2dcf2740cdd124c73b8236bdc9dbb0e7c80fdd21bdafd4a9a271748a1924d3bd6a59209e62622b236b
7
- data.tar.gz: a74e83718ac402acf62a378e9d9fe073e4486e33fc5a6628b80f3c50ee4bcdb69d1f0812012a58eb86528fd86c9b7e18b7fee30eacf3fce98ce0adc5139b5d35
6
+ metadata.gz: 2373472d97e3f0e51c3d3ed5b69f1f017b971cda7d8ada480196cf43e25decb7c9b89fb75c7f6722eae1d3d16dda6bd16477a1074736ef6b6d58527f808dd649
7
+ data.tar.gz: 080f956a9906e90f05a95643b0dd427d359d86ab3aa90ad5fef795f182259d083eeae6d65aa81aa93aa4c158b57f247686f96222d79669255834b8c4527a6ed7
@@ -1,3 +1,4 @@
1
+ #encoding: utf-8
1
2
  module TuraTEL
2
3
  class SMS
3
4
  def self.send_sms(recipient, message_text, opts={})
@@ -5,9 +6,15 @@ module TuraTEL
5
6
  valid_options.merge!(:start_date => TuraTEL::DATE.now) unless valid_options[:start_date]
6
7
  valid_options.merge!(:stop_date => TuraTEL::DATE.n_hour_from_now(1)) unless valid_options[:stop_date]
7
8
 
9
+ if (message_text.chars.uniq & ['İ','Ğ','Ş','ı','ğ','ş']).empty?
10
+ type = "1"
11
+ else
12
+ type = "2"
13
+ end
14
+ valid_options.merge!(:type => type)
15
+
8
16
  body = TuraTEL::XmlBody.send_sms_body(recipient, message_text, valid_options)
9
-
10
- puts body if TuraTEL.configuration.debug
17
+ puts body if TuraTEL.configuration.debug
11
18
 
12
19
  response = send_request(body)
13
20
 
@@ -8,9 +8,9 @@ module TuraTEL
8
8
  <ChannelCode>#{TuraTEL.configuration.channel_code}</ChannelCode>
9
9
  <UserName>#{TuraTEL.configuration.usercode}</UserName>
10
10
  <PassWord>#{TuraTEL.configuration.password}</PassWord>
11
- <Mesgbody>#{message_text}</Mesgbody>
11
+ <Mesgbody><![CDATA[#{message_text}]]></Mesgbody>
12
12
  <Numbers>#{recipient}</Numbers>
13
- <Type>1</Type>
13
+ <Type>#{valid_options[:type]}</Type>
14
14
  <Originator>#{valid_options[:from]}</Originator>
15
15
  </MainmsgBody>"
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turatel_sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - IPOS - Huseyin Gomleksizoglu