FIX: Do not show recipient user in email participants list (#14642)

This commit removes the recipient's username from the
respond to / participants list that is shown at the bottom
of user notification emails. For example if the recipient's
username was jsmith, and there were participants ljones and
bmiller, we currently show this:

> "reply to this email to respond to jsmith, ljones, bmiller"

or

> "Participants: jsmith, ljones, bmiller"

However this is a bit redundant, as you are not replying to
yourself here if you are the recipient user. So we omit the
recipient user's username from this list, which is only used
in the text of the email and not elsewhere.
This commit is contained in:
Martin Brennan
2021-10-19 15:26:22 +10:00
committed by GitHub
parent 2364626ded
commit d3678f6930
4 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -591,14 +591,14 @@ describe UserNotifications do
expect(mail.subject).to include("[PM] ")
end
it "includes a list of participants, groups first with member lists" do
it "includes a list of participants (except for the destination user), groups first with member lists" do
group1 = Fabricate(:group, name: "group1")
group2 = Fabricate(:group, name: "group2")
user1 = Fabricate(:user, username: "one", groups: [group1, group2])
user2 = Fabricate(:user, username: "two", groups: [group1])
topic.allowed_users = [user1, user2]
topic.allowed_users = [user, user1, user2]
topic.allowed_groups = [group1, group2]
mail = UserNotifications.user_private_message(