UX: change 'Visit Topic' to 'Visit Message' for message notification email

This commit is contained in:
Arpit Jalan 2016-02-09 13:39:10 +05:30
parent 3df2ee3431
commit 82a75c00c0
4 changed files with 11 additions and 3 deletions

View File

@ -1984,6 +1984,8 @@ en:
header_instructions: ''
reply_by_email: "[Visit Topic](%{base_url}%{url}) or reply to this email to respond"
visit_link_to_respond: "[Visit Topic](%{base_url}%{url}) to respond"
reply_by_email_pm: "[Visit Message](%{base_url}%{url}) or reply to this email to respond"
visit_link_to_respond_pm: "[Visit Message](%{base_url}%{url}) to respond"
posted_by: "Posted by %{username} on %{post_date}"

View File

@ -34,9 +34,9 @@ module Email
@template_args[:respond_instructions] = ''
else
@template_args[:respond_instructions] = if allow_reply_by_email?
I18n.t('user_notifications.reply_by_email', @template_args)
@opts[:private_reply] ? I18n.t('user_notifications.reply_by_email_pm', @template_args) : I18n.t('user_notifications.reply_by_email', @template_args)
else
I18n.t('user_notifications.visit_link_to_respond', @template_args)
@opts[:private_reply] ? I18n.t('user_notifications.visit_link_to_respond_pm', @template_args) : I18n.t('user_notifications.visit_link_to_respond', @template_args)
end
end
end

View File

@ -194,7 +194,7 @@ describe Email::MessageBuilder do
end
it "does not add unsubscribe via email link without site setting set" do
expect(message_with_unsubscribe_via_email.body).to_not match(/mailto:reply@#{Discourse.current_hostname}\?subject=unsubscribe/)
expect(message_with_unsubscribe_via_email.body).to_not match(/mailto:reply@#{Discourse.current_hostname}\?subject=unsubscribe/)
end
end

View File

@ -111,6 +111,9 @@ describe UserNotifications do
# subject should include category name
expect(mail.subject).to match(/India/)
# 2 "visit topic" link
expect(mail.html_part.to_s.scan(/Visit Topic/).count).to eq(2)
# 2 respond to links cause we have 1 context post
expect(mail.html_part.to_s.scan(/to respond/).count).to eq(2)
@ -181,6 +184,9 @@ describe UserNotifications do
# subject should include "[PM]"
expect(mail.subject).to match("[PM]")
# 1 "visit message" link
expect(mail.html_part.to_s.scan(/Visit Message/).count).to eq(1)
# 1 respond to link
expect(mail.html_part.to_s.scan(/to respond/).count).to eq(1)