feat: Slack link unfurling (#7940)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
co-authored by
Pranav Raj S
parent
845b0c0a68
commit
24fe3805d8
@@ -0,0 +1,21 @@
|
||||
module Slack
|
||||
module Web
|
||||
module Api
|
||||
module Endpoints
|
||||
module Chat
|
||||
# TODO: Remove this monkey patch when PR for this issue https://github.com/slack-ruby/slack-ruby-client/issues/388 is merged
|
||||
def chat_unfurl(options = {})
|
||||
if (options[:channel].nil? || options[:ts].nil?) && (options[:unfurl_id].nil? || options[:source].nil?)
|
||||
raise ArgumentError, 'Either a combination of :channel and :ts or :unfurl_id and :source is required'
|
||||
end
|
||||
|
||||
raise ArgumentError, 'Required arguments :unfurls missing' if options[:unfurls].nil?
|
||||
|
||||
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
||||
post('chat.unfurl', options)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -218,3 +218,12 @@ en:
|
||||
made_with: Made with
|
||||
header:
|
||||
go_to_homepage: Go to the main site
|
||||
slack_unfurl:
|
||||
fields:
|
||||
name: Name
|
||||
email: Email
|
||||
phone_number: Phone
|
||||
company_name: Company
|
||||
inbox_name: Inbox
|
||||
inbox_type: Inbox Type
|
||||
button: Open conversation
|
||||
|
||||
Reference in New Issue
Block a user