FIX: Show inviter name in email's from field (#13141)

'From' field of the email contained the name of the user who posted the
shared post. Instead, it should contain the name of the inviter.
This commit is contained in:
Dan Ungureanu
2021-05-26 05:55:07 +03:00
committed by GitHub
parent f78fa76847
commit a5273b37f7
3 changed files with 46 additions and 3 deletions

View File

@@ -422,7 +422,7 @@ class UserNotifications < ActionMailer::Base
user_name = notification_data[:original_username]
if post && SiteSetting.enable_names && SiteSetting.display_name_on_email_from
name = User.where(id: post.user_id).pluck_first(:name)
name = User.where(id: notification_data[:original_user_id] || post.user_id).pluck_first(:name)
user_name = name unless name.blank?
end