mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Missing links in notifications & emails for adding and removing a user to the team [SCI-9880]
This commit is contained in:
parent
528d411910
commit
0e0f7fe0da
1 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module NotificationsHelper
|
||||
def send_email_notification(user, notification)
|
||||
AppMailer.delay.notification(user.id, notification)
|
||||
|
@ -10,20 +12,25 @@ module NotificationsHelper
|
|||
unassigned_user: target_user.name,
|
||||
team: team.name,
|
||||
unassigned_by_user: user.name)
|
||||
message = team.name
|
||||
|
||||
if role
|
||||
title = I18n.t('notifications.assign_user_to_team',
|
||||
assigned_user: target_user.name,
|
||||
role: role,
|
||||
team: team.name,
|
||||
assigned_by_user: user.name)
|
||||
message = ActionController::Base.helpers.sanitize(
|
||||
"<a href=#{projects_path(team: team)} target='_blank'>#{team.name}</a>"
|
||||
)
|
||||
|
||||
end
|
||||
message = "#{I18n.t('search.index.team')} #{team.name}"
|
||||
end
|
||||
|
||||
GeneralNotification.send_notifications({
|
||||
type: role ? :invite_user_to_team : :remove_user_from_team,
|
||||
title: sanitize_input(title),
|
||||
message: sanitize_input(message),
|
||||
message: message,
|
||||
user: target_user
|
||||
})
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue