Class: LucidIntercom::SendMessage
- Inherits:
-
Object
- Object
- LucidIntercom::SendMessage
- Defined in:
- lib/lucid_intercom/send_message.rb
Instance Method Summary collapse
- #call(to, body) ⇒ Object
-
#initialize(post_request: Container[:post_request]) ⇒ SendMessage
constructor
A new instance of SendMessage.
Constructor Details
#initialize(post_request: Container[:post_request]) ⇒ SendMessage
Returns a new instance of SendMessage.
10 11 12 |
# File 'lib/lucid_intercom/send_message.rb', line 10 def initialize(post_request: Container[:post_request]) @post_request = post_request end |
Instance Method Details
#call(to, body) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/lucid_intercom/send_message.rb', line 18 def call(to, body) @post_request.('messages', { message_type: 'inapp', body: body, from: { type: 'admin', id: LucidIntercom.config.admin_id, }, to: { type: 'user', email: to, }, }) end |