websms 0.0.2 → 0.0.3
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/README.md +1 -0
- data/lib/websms/configuration.rb +3 -1
- data/lib/websms/sender.rb +4 -2
- data/lib/websms/version.rb +1 -1
- 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: 7316a7da74d90c862c19ff0d7b6bd4fc304f8dae
|
4
|
+
data.tar.gz: a9e2dfc7b4feb7d9a612c3190521bc02ff7ffab5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5a16963a1e2065f7c14eb3cf0e9e82b678e6f9ba65e898f90fe4e69b4631c46e7aa71f9b0748996f9f21132f42d46120213bfc3cad422ad51bb010f0a36383
|
7
|
+
data.tar.gz: 43b180772ad749c0432271c0339a92935ff7a870483a5f910ca200eca1c4a50dee1fc6ca825e5fc6829ca0a78d544a602bae6fa42a349a2fef535aaa3626d026
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Add into environments/environment.rb after app configuration
|
|
24
24
|
c.api_user = 'your_user_name'
|
25
25
|
c.api_password = 'your_api_password'
|
26
26
|
c.client_id = '' # optional. If set will be shown first.
|
27
|
+
c.alfanum_from = 'YourFrom' # optional. To set from if you are using it.
|
27
28
|
end
|
28
29
|
|
29
30
|
When you need to send sms call
|
data/lib/websms/configuration.rb
CHANGED
data/lib/websms/sender.rb
CHANGED
@@ -22,11 +22,13 @@ module Websms
|
|
22
22
|
text = "#{c.client_id}: #{text}" if c.client_id
|
23
23
|
etext = text.gsub(' ', '%20')
|
24
24
|
etext = Iconv.conv('windows-1251', 'utf-8', etext)
|
25
|
+
|
26
|
+
from_phone = c.alfanum_from ? "&fromPhone=#{c.alfanum_from}" : ''
|
25
27
|
# Send request
|
26
|
-
request = "#{sms_gateway}?
|
28
|
+
request = "#{sms_gateway}?http_username=#{sms_user}&http_password=#{sms_password}#{from_phone}&Phone_list=#{number}&Message=#{etext}"
|
27
29
|
c = Curl::Easy.perform(request)
|
28
30
|
end
|
29
31
|
|
30
32
|
end
|
31
33
|
|
32
|
-
end
|
34
|
+
end
|
data/lib/websms/version.rb
CHANGED