From 4a5103b446a9eb08510ce92bf81efcdbbb10da93 Mon Sep 17 00:00:00 2001 From: Teal <git@teal.is> Date: Mon, 27 May 2024 16:32:58 +0200 Subject: [PATCH] use url instead of path for notifications --- app/subscribers/telegram_bot_subscriber.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/subscribers/telegram_bot_subscriber.rb b/app/subscribers/telegram_bot_subscriber.rb index 271524b..9d7d558 100644 --- a/app/subscribers/telegram_bot_subscriber.rb +++ b/app/subscribers/telegram_bot_subscriber.rb @@ -25,8 +25,8 @@ class TelegramBotSubscriber changes.delete("stage_id") end - message = "<b><a href=\"#{conference_session_path(record.conference, record)}\">Session #{record.title}</a> #{action}</b>\n" + - changes.map { |attr, (from, to)| "- #{attr}: #{from} -> #{to}" }.join("\n") + "\n#{conference_session_path(record.conference, record)}" + message = "<b><a href=\"#{conference_session_url(record.conference, record)}\">Session #{record.title}</a> #{action}</b>\n" + + changes.map { |attr, (from, to)| "- #{attr}: #{from} -> #{to}" }.join("\n") + "\n#{conference_session_url(record.conference, record)}" TelegramGroupChatNotificationJob.perform_later(target: "-316096320", text: message, parse_mode: 'HTML') # TelegramGroupChatNotificationJob.perform_later(target: "2192297", text: message, parse_mode: 'HTML') @@ -38,8 +38,8 @@ class TelegramBotSubscriber record = event.payload[:record] session = record.session - message = "<b><a href=\"#{conference_session_path(session.conference, session)}\">Session #{session.title}</a> Speaker Change</b>\n" + - "#{record.speaker.name} #{action == 'destroyed' ? 'removed' : 'added'}" + "\n#{conference_session_path(session.conference, session)}" + message = "<b><a href=\"#{conference_session_url(session.conference, session)}\">Session #{session.title}</a> Speaker Change</b>\n" + + "#{record.speaker.name} #{action == 'destroyed' ? 'removed' : 'added'}" + "\n#{conference_session_url(session.conference, session)}" TelegramGroupChatNotificationJob.perform_later(target: "-316096320", text: message, parse_mode: 'HTML') end -- GitLab