Class: OmniKiq::Workers::SendScheduledSmsWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/omnikiq/workers/send_scheduled_sms_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(sms_message_id, device_id) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/omnikiq/workers/send_scheduled_sms_worker.rb', line 8

def perform(sms_message_id, device_id)
  http = Net::HTTP.new(::OmniApi.config.base_url)
  path = "/api/v1/sms_messages/#{sms_message_id}"

  data = { state: 'sending', device_id: device_id }.to_json
  header = { 'Authorization' => OmniApi.config.client_access_token }
  http.send_request('PATCH', path, data, header)
end