nuntius 1.3.9 → 1.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b8c06436ff50243ea78fd29e0e315aacfdab4260635a0412dcdf78b5b6b9c87
4
- data.tar.gz: 9c64d408b5d449cf7f2f289a7f1a5db7c6490e7208e4322c2531711739a7a9e8
3
+ metadata.gz: d80f837502d4afc4babaf911275eba0c67476a66d62df91be28c04608f129c65
4
+ data.tar.gz: 89f61b707746dfec09a7ae5a1abd0c6e7233a71a8dbd0e87961a9cc9f056ebcb
5
5
  SHA512:
6
- metadata.gz: 63b1e50d17f3228e6d45b8d664fabc793708cb3ef6cf2c3c0ff33cda6020dd737951b889a6428b4f78c29bdb081ce66c97bc581f4cad09d791fa05dc61b6cfdd
7
- data.tar.gz: f97c503e53cafad4c36fdf2b092f0c609810969b06ba525149184a2c0d0b12a2e6f1e9183eeb396e5129937fe7b546a0092870ab369b7d87b6c3c806410d17b9
6
+ metadata.gz: 9038e4c6ab0903f12326bd620b3964bb628002b972db9f8aeb490ad5425edae0bddcedd67f6b5a529b09591277bf2d1d74b14d4d92aad31a29051ffe415b14da
7
+ data.tar.gz: c3748e0f1ffd10ea3b7215123d7bc6f6e4caad057622dfaa776be5eda955d6fb44214b4c2f61e3c38d35df73095f9f056b3fedfb9554c7a4060af734a6a44bb1
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "smstools_api"
4
+
5
+ module Nuntius
6
+ # Send SMS messages using smstools.nl
7
+ class SmstoolsSmsProvider < BaseProvider
8
+ transport :sms
9
+
10
+ setting_reader :client_id, required: true, description: "Client ID"
11
+ setting_reader :client_secret, required: true, description: "Client Secret"
12
+ setting_reader :from, required: true, description: "Phone-number or name (example: 'Nuntius') to send the message from"
13
+
14
+ # Twilio statusses: queued, failed, sent, delivered, or undelivered
15
+ states %w[failed undelivered] => "undelivered", "delivered" => "delivered"
16
+
17
+ def deliver
18
+ response = client.messages.create(from: message.from.present? ? message.from : from, to: message.to, message: message.text)
19
+ message.provider_id = response.sid
20
+ message.status = translated_status(response.status)
21
+ message
22
+ end
23
+
24
+ private
25
+
26
+ def client
27
+ @client ||= SmstoolsApi::Client.new(client_id: client_id, client_secret: client_secret)
28
+ end
29
+ end
30
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
- VERSION = "1.3.9"
4
+ VERSION = "1.3.10"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuntius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.9
4
+ version: 1.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apnotic
@@ -346,6 +346,20 @@ dependencies:
346
346
  - - "~>"
347
347
  - !ruby/object:Gem::Version
348
348
  version: 7.0.2
349
+ - !ruby/object:Gem::Dependency
350
+ name: smstools_api
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - "~>"
354
+ - !ruby/object:Gem::Version
355
+ version: 0.1.3
356
+ type: :runtime
357
+ prerelease: false
358
+ version_requirements: !ruby/object:Gem::Requirement
359
+ requirements:
360
+ - - "~>"
361
+ - !ruby/object:Gem::Version
362
+ version: 0.1.3
349
363
  - !ruby/object:Gem::Dependency
350
364
  name: slim-rails
351
365
  requirement: !ruby/object:Gem::Requirement
@@ -485,6 +499,7 @@ files:
485
499
  - app/providers/nuntius/houston_push_provider.rb
486
500
  - app/providers/nuntius/message_bird_sms_provider.rb
487
501
  - app/providers/nuntius/slack_slack_provider.rb
502
+ - app/providers/nuntius/smstools_sms_provider.rb
488
503
  - app/providers/nuntius/smtp_mail_provider.rb
489
504
  - app/providers/nuntius/teams_teams_provider.rb
490
505
  - app/providers/nuntius/twilio_sms_provider.rb