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 +4 -4
- data/lib/turatel_sms/sms.rb +9 -2
- data/lib/turatel_sms/xml_body.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08a25902698fb14d3ad0c4f607c57c888811b359
|
4
|
+
data.tar.gz: e8f4b2eaf09bf51ea363c94cef02ce4e9c5a58c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2373472d97e3f0e51c3d3ed5b69f1f017b971cda7d8ada480196cf43e25decb7c9b89fb75c7f6722eae1d3d16dda6bd16477a1074736ef6b6d58527f808dd649
|
7
|
+
data.tar.gz: 080f956a9906e90f05a95643b0dd427d359d86ab3aa90ad5fef795f182259d083eeae6d65aa81aa93aa4c158b57f247686f96222d79669255834b8c4527a6ed7
|
data/lib/turatel_sms/sms.rb
CHANGED
@@ -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
|
|
data/lib/turatel_sms/xml_body.rb
CHANGED
@@ -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
|
11
|
+
<Mesgbody><![CDATA[#{message_text}]]></Mesgbody>
|
12
12
|
<Numbers>#{recipient}</Numbers>
|
13
|
-
<Type
|
13
|
+
<Type>#{valid_options[:type]}</Type>
|
14
14
|
<Originator>#{valid_options[:from]}</Originator>
|
15
15
|
</MainmsgBody>"
|
16
16
|
end
|