Skip to content

A platform for community discussion. Free, open, simple.

FIX: do not add `_pm` suffix to locale key when email is from system user (#31505)

Penar Musarajf498c3b3e81a
diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb
index 1284ba93727..062d0757bb0 100644
--- a/lib/email/message_builder.rb
+++ b/lib/email/message_builder.rb
@@ -47,7 +47,9 @@ module Email
else
if @opts[:only_reply_by_email]
string = +"user_notifications.only_reply_by_email"
- string << "_pm" if @opts[:private_reply]
+ if @opts[:private_reply] && @opts[:username] != Discourse.system_user.username
+ string << "_pm"
+ end
else
string =
(
@@ -57,7 +59,9 @@ module Email
+@visit_link_to_respond_key
end
)
- string << "_pm" if @opts[:private_reply]
+ if @opts[:private_reply] && @opts[:username] != Discourse.system_user.username
+ string << "_pm"
+ end
end
@template_args[:respond_instructions] = "---\n" + I18n.t(string, @template_args)
end