Method: Frontapp::Client::Messages#receive_custom_message

Defined in:
lib/frontapp/client/messages.rb

#receive_custom_message(channel_id, params) ⇒ Object

Parameters Name Type Description


channel_id string Id of the requested custom channel


Allowed attributes: Name Type Description


sender object Data of the sender sender.contact_id string (optional) ID of the contact in Front corresponding to the sender sender.name string (optional) Name of the sender sender.handle string Handle of the sender. It can be any string used to uniquely identify the sender subject string (optional) Subject of the message body string Body of the message body_format enum (optional) Format of the message body. (Default: ‘markdown’) attachments array (optional) Binary data of the attached files. Available only for multipart request. metadata object (optional) metadata.thread_ref string (optional) Custom reference which will be used to thread messages. If you ommit this field, we’ll thread by sender instead metadata.headers object (optional) Custom object where any internal information can be stored




119
120
121
122
123
124
125
126
127
# File 'lib/frontapp/client/messages.rb', line 119

def receive_custom_message(channel_id, params)
  cleaned = params.permit({ sender: [:contact_id, :name, :handle] },
                          :subject,
                          :body,
                          :body_format,
                          :attachments,
                          { metadata: [:thread_ref, :headers] })
  create("channels/#{channel_id}/incoming_messages", cleaned)
end