Class: Fastlane::Notification::Slack
- Inherits:
-
Object
- Object
- Fastlane::Notification::Slack
- Defined in:
- fastlane/lib/fastlane/notification/slack.rb
Defined Under Namespace
Classes: LinkConverter
Instance Method Summary collapse
-
#initialize(webhook_url) ⇒ Slack
constructor
A new instance of Slack.
-
#post_to_legacy_incoming_webhook(channel:, username:, attachments:, link_names:, icon_url:) ⇒ Object
Overriding channel, icon_url and username is only supported in legacy incoming webhook.
Constructor Details
Instance Method Details
#post_to_legacy_incoming_webhook(channel:, username:, attachments:, link_names:, icon_url:) ⇒ Object
Overriding channel, icon_url and username is only supported in legacy incoming webhook. Also note that the use of attachments has been discouraged by Slack, in favor of Block Kit. api.slack.com/legacy/custom-integrations/messaging/webhooks
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'fastlane/lib/fastlane/notification/slack.rb', line 14 def post_to_legacy_incoming_webhook(channel:, username:, attachments:, link_names:, icon_url:) @client.post(@webhook_url) do |request| request.headers['Content-Type'] = 'application/json' request.body = { channel: channel, username: username, icon_url: icon_url, attachments: , link_names: link_names }.to_json end end |