mitake_sms 1.5.2 → 1.6.0
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/CHANGELOG.md +10 -0
- data/README.md +2 -1
- data/lib/mitake_sms/client.rb +3 -1
- data/lib/mitake_sms/configuration.rb +1 -1
- data/lib/mitake_sms/version.rb +1 -1
- data/lib/mitake_sms.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c363dc8dd6553a342f2e38afb125c68e77f9312dcb804ca067b12d828ea33a23
|
4
|
+
data.tar.gz: 2232bcf3e90cbcd41b3933d1e56df41934a88fba3fe03c6c8dc41ddebc7e0a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86ff828f6173002ae80d1a3db3da9f26cf711136026bf7492102e09f63ecb58aa6478d6b0afb22dae8455ae8ff697a3c65f282b2e8a5affc18c1d4c6cd3ca38a
|
7
|
+
data.tar.gz: 539afb9e3ea2adb46591fe17d36e0850d1d0aa8769636efaadb414d980ca57049234ac19f98d99f0e94ec925018845272c9d4adcf1219df26071601c99ae5b03
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [1.6.0] - 2025-05-25
|
11
|
+
### Added
|
12
|
+
- Added `destname` parameter to `send_sms` method for recipient name or system integration key value
|
13
|
+
- Added tests for the new `destname` parameter
|
14
|
+
|
15
|
+
## [1.5.3] - 2025-05-25
|
16
|
+
### Changed
|
17
|
+
- Updated the default API URL to `https://smsapi.mitake.com.tw/api/mtk/`
|
18
|
+
- Cleaned up whitespace in the codebase
|
19
|
+
|
10
20
|
## [1.5.2] - 2025-05-25
|
11
21
|
### Changed
|
12
22
|
- Modified `send_sms` method to keep only `CharsetURL` in query string and put all other parameters in POST body
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ require 'mitake_sms'
|
|
47
47
|
MitakeSms.configure do |config|
|
48
48
|
config.username = 'your_username' # Your Mitake SMS API username
|
49
49
|
config.password = 'your_password' # Your Mitake SMS API password
|
50
|
-
config.api_url = 'https://
|
50
|
+
config.api_url = 'https://smsapi.mitake.com.tw/api/mtk/' # Default API URL
|
51
51
|
end
|
52
52
|
```
|
53
53
|
|
@@ -68,6 +68,7 @@ end
|
|
68
68
|
response = MitakeSms.send_sms(
|
69
69
|
to: '0912345678',
|
70
70
|
text: 'Hello with options!',
|
71
|
+
destname: 'John Doe', # Recipient name or integration key value
|
71
72
|
response_url: 'https://your-callback-url.com/delivery-reports',
|
72
73
|
client_id: 'your-client-reference-id',
|
73
74
|
charset: 'BIG5' # Override the default UTF-8 encoding if needed
|
data/lib/mitake_sms/client.rb
CHANGED
@@ -22,16 +22,18 @@ module MitakeSms
|
|
22
22
|
# Send a single SMS
|
23
23
|
# @param to [String] recipient phone number
|
24
24
|
# @param text [String] message content
|
25
|
+
# @param destname [String] recipient name or key value for system integration (optional)
|
25
26
|
# @param response_url [String] callback URL for delivery reports (optional)
|
26
27
|
# @param client_id [String] client reference ID (optional)
|
27
28
|
# @param charset [String] character encoding, defaults to 'UTF8' (optional)
|
28
29
|
# @param options [Hash] additional options (optional)
|
29
30
|
# @return [MitakeSms::Response] response object
|
30
|
-
def send_sms(to:, text:, response_url: nil, client_id: nil, charset: 'UTF8', **options)
|
31
|
+
def send_sms(to:, text:, destname: nil, response_url: nil, client_id: nil, charset: 'UTF8', **options)
|
31
32
|
require 'uri'
|
32
33
|
|
33
34
|
# Create options hash with only non-nil values
|
34
35
|
param_options = {}
|
36
|
+
param_options[:destname] = destname if destname
|
35
37
|
param_options[:response_url] = response_url if response_url
|
36
38
|
param_options[:client_id] = client_id if client_id
|
37
39
|
|
@@ -8,7 +8,7 @@ module MitakeSms
|
|
8
8
|
|
9
9
|
setting :username, default: ENV['MITAKE_USERNAME']
|
10
10
|
setting :password, default: ENV['MITAKE_PASSWORD']
|
11
|
-
setting :api_url, default: 'https://
|
11
|
+
setting :api_url, default: 'https://smsapi.mitake.com.tw/api/mtk/'
|
12
12
|
setting :timeout, default: 30
|
13
13
|
setting :open_timeout, default: 5
|
14
14
|
|
data/lib/mitake_sms/version.rb
CHANGED
data/lib/mitake_sms.rb
CHANGED
@@ -38,16 +38,18 @@ module MitakeSms
|
|
38
38
|
# Send a single SMS message
|
39
39
|
# @param to [String] recipient phone number
|
40
40
|
# @param text [String] message content
|
41
|
+
# @param destname [String] recipient name or key value for system integration (optional)
|
41
42
|
# @param response_url [String] callback URL for delivery reports (optional)
|
42
43
|
# @param client_id [String] client reference ID (optional)
|
43
44
|
# @param charset [String] character encoding, defaults to 'UTF8' (optional)
|
44
45
|
# @param options [Hash] additional options (optional)
|
45
46
|
# @return [MitakeSms::Response] response object
|
46
|
-
def send_sms(to:, text:, response_url: nil, client_id: nil, charset: 'UTF8', **options)
|
47
|
+
def send_sms(to:, text:, destname: nil, response_url: nil, client_id: nil, charset: 'UTF8', **options)
|
47
48
|
# Forward all parameters to the client method using named parameters
|
48
49
|
client.send_sms(
|
49
50
|
to: to,
|
50
51
|
text: text,
|
52
|
+
destname: destname,
|
51
53
|
response_url: response_url,
|
52
54
|
client_id: client_id,
|
53
55
|
charset: charset,
|