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

See
https://meta.discourse.org/t/email-footer-says-visit-message-to-respond-to-no-names-after-to/354359

There may be a deeper root issue somewhere further up the stack, but
this change ensures we always use the `visit_link_to_respond` locale key
when the PM is from `system`. Seems cleaner than copy that says `to
respond to system`.

Before

![CleanShot 2025-02-25 at 10 38
44@2x](https://github.com/user-attachments/assets/ef12a957-72f7-418e-a109-448384e32def)

After

![CleanShot 2025-02-25 at 10 38
25@2x](https://github.com/user-attachments/assets/d8359812-63c5-444a-b36a-75a2e0bcfbb0)
This commit is contained in:
Penar Musaraj
2025-02-25 11:37:52 -05:00
committed by GitHub
parent 1d7663d63c
commit f498c3b3e8

View File

@ -47,7 +47,9 @@ module Email
else else
if @opts[:only_reply_by_email] if @opts[:only_reply_by_email]
string = +"user_notifications.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 else
string = string =
( (
@ -57,7 +59,9 @@ module Email
+@visit_link_to_respond_key +@visit_link_to_respond_key
end end
) )
string << "_pm" if @opts[:private_reply] if @opts[:private_reply] && @opts[:username] != Discourse.system_user.username
string << "_pm"
end
end end
@template_args[:respond_instructions] = "---\n" + I18n.t(string, @template_args) @template_args[:respond_instructions] = "---\n" + I18n.t(string, @template_args)
end end