slack.rb 687 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Webhook::PreDefined::Slack < Webhook::PreDefined
  3. def name
  4. __('Slack Notifications')
  5. end
  6. # rubocop:disable Lint/InterpolationCheck
  7. def custom_payload
  8. {
  9. mrkdwn: true,
  10. text: '# #{ticket.title}',
  11. attachments: [
  12. {
  13. text: "_[Ticket#\#{ticket.number}](\#{notification.link}): \#{notification.message}_\n\n\#{notification.changes}\n\n\#{notification.body}",
  14. mrkdwn_in: [
  15. 'text'
  16. ],
  17. color: '#{ticket.current_state_color}'
  18. }
  19. ]
  20. }
  21. end
  22. # rubocop:enable Lint/InterpolationCheck
  23. end