diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /lib/microsoft_teams | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'lib/microsoft_teams')
-rw-r--r-- | lib/microsoft_teams/notifier.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/microsoft_teams/notifier.rb b/lib/microsoft_teams/notifier.rb index 0b21c355a54..39005f56dcb 100644 --- a/lib/microsoft_teams/notifier.rb +++ b/lib/microsoft_teams/notifier.rb @@ -14,7 +14,7 @@ module MicrosoftTeams response = Gitlab::HTTP.post( @webhook.to_str, headers: @header, - body: body(options) + body: body(**options) ) result = true if response @@ -27,14 +27,13 @@ module MicrosoftTeams private - def body(options = {}) + def body(title: nil, summary: nil, attachments: nil, activity:) result = { 'sections' => [] } - result['title'] = options[:title] - result['summary'] = options[:summary] - result['sections'] << MicrosoftTeams::Activity.new(options[:activity]).prepare + result['title'] = title + result['summary'] = summary + result['sections'] << MicrosoftTeams::Activity.new(**activity).prepare - attachments = options[:attachments] unless attachments.blank? result['sections'] << { text: attachments } end |