Class: MessageSmsNotification

Inherits:
Object
  • Object
show all
Defined in:
app/models/message_sms_notification.rb

Overview

SMS notification service for Messages and Notifications sent to Participants.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body:, phone_number:) ⇒ MessageSmsNotification

Returns a new instance of MessageSmsNotification.



5
6
7
8
# File 'app/models/message_sms_notification.rb', line 5

def initialize(body:, phone_number:)
  @body = body
  @phone_number = phone_number
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'app/models/message_sms_notification.rb', line 3

def body
  @body
end

#phone_numberObject (readonly)

Returns the value of attribute phone_number.



3
4
5
# File 'app/models/message_sms_notification.rb', line 3

def phone_number
  @phone_number
end

Instance Method Details

#deliverObject



10
11
12
13
14
15
16
# File 'app/models/message_sms_notification.rb', line 10

def deliver
  if environment.staging? || environment.production?
    sms_client..messages.create message
  else
    message
  end
end