Sha256: cce134ed6c4b4a249188f63e920472ec961fa3ca61202a8a9109947a1ceae1f6

Contents?: true

Size: 608 Bytes

Versions: 8

Compression:

Stored size: 608 Bytes

Contents

require 'httparty'
module ScalingoBackupsManager

  class Notification

    def self.send_slack_notification(hook_url, message)
      HTTParty.post(
        hook_url,
        body: {
          message: message
        }.to_json,
        headers: { 'Content-Type' => 'application/json' }
      )
    end

    def self.send_discord_notification(hook_url, message)
      payload = {
        user: 'Scalingo backups manager',
        content: message
      }.to_json
      HTTParty.post(
        hook_url,
        body: payload,
        headers: { 'Content-Type': 'application/json' }
      )
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scalingo_backups_manager-0.8.0 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.7.0 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.6.5 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.6.4 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.6.3 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.6.2 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.6.1 lib/scalingo_backups_manager/notification.rb
scalingo_backups_manager-0.6.0 lib/scalingo_backups_manager/notification.rb