mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
25 lines
687 B
Ruby
25 lines
687 B
Ruby
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
class Webhook::PreDefined::Slack < Webhook::PreDefined
|
|
def name
|
|
__('Slack Notifications')
|
|
end
|
|
|
|
# rubocop:disable Lint/InterpolationCheck
|
|
def custom_payload
|
|
{
|
|
mrkdwn: true,
|
|
text: '# #{ticket.title}',
|
|
attachments: [
|
|
{
|
|
text: "_[Ticket#\#{ticket.number}](\#{notification.link}): \#{notification.message}_\n\n\#{notification.changes}\n\n\#{notification.body}",
|
|
mrkdwn_in: [
|
|
'text'
|
|
],
|
|
color: '#{ticket.current_state_color}'
|
|
}
|
|
]
|
|
}
|
|
end
|
|
# rubocop:enable Lint/InterpolationCheck
|
|
end
|