Skip to content

Commit

Permalink
Fix locales that require a 'host' variable (#5273)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozovalihasan authored Dec 13, 2024
1 parent 8d341cc commit 0a81b21
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/mailers/mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ def admin_manual(user, subject, body)

def deletion_complete(email)
mail to: email,
subject: I18n.t("mailer.deletion_complete.subject")
subject: I18n.t("mailer.deletion_complete.subject", host: Gemcutter::HOST_DISPLAY)
end

def deletion_failed(email)
mail to: email,
subject: I18n.t("mailer.deletion_failed.subject")
subject: I18n.t("mailer.deletion_failed.subject", host: Gemcutter::HOST_DISPLAY)
end

def notifiers_changed(user_id)
@user = User.find(user_id)
@ownerships = @user.ownerships.by_indexed_gem_name

mail to: @user.email,
subject: I18n.t("mailer.notifiers_changed.subject",
subject: I18n.t("mailer.notifiers_changed.subject", host: Gemcutter::HOST_DISPLAY,
default: "You changed your RubyGems.org email notification settings")
end

Expand Down
4 changes: 2 additions & 2 deletions app/mailers/web_hooks_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def webhook_deleted(user_id, rubygem_id, url, failure_count)
@failure_count = failure_count

mail to: @user.email,
subject: t("mailer.web_hook_deleted.subject") do |format|
subject: t("mailer.web_hook_deleted.subject", host: Gemcutter::HOST_DISPLAY) do |format|
format.html
format.text
end
Expand All @@ -17,7 +17,7 @@ def webhook_disabled(web_hook)
@delete_command = "gem install gemcutter && gem webhook#{" #{web_hook.rubygem.name}" unless web_hook.global?} --remove '#{web_hook.url}'"

mail to: web_hook.user.email,
subject: t("mailer.web_hook_disabled.subject") do |format|
subject: t("mailer.web_hook_disabled.subject", host: Gemcutter::HOST_DISPLAY) do |format|
format.html
format.text
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/mailer/email_confirmation.text.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Hi <%= @user.handle %>

<%= t("mailer.email_confirmation.welcome_message") %>
<%= t("mailer.email_confirmation.welcome_message", host: Gemcutter::HOST_DISPLAY) %>
<%= update_email_confirmations_url(token: @user.confirmation_token.html_safe) %>
2 changes: 1 addition & 1 deletion test/integration/notification_settings_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class NotificationSettingsTest < SystemTest

assert_emails 1

assert_equal I18n.t("mailer.notifiers_changed.subject"), last_email.subject
assert_equal I18n.t("mailer.notifiers_changed.subject", host: Gemcutter::HOST_DISPLAY), last_email.subject

assert_selector "#flash_notice", text: I18n.t("notifiers.update.success")

Expand Down
2 changes: 1 addition & 1 deletion test/system/avo/web_hooks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ class Avo::WebHooksSystemTest < ApplicationSystemTestCase

perform_enqueued_jobs only: ActionMailer::MailDeliveryJob

assert_equal I18n.t("mailer.web_hook_deleted.subject"), last_email.subject
assert_equal I18n.t("mailer.web_hook_deleted.subject", host: Gemcutter::HOST_DISPLAY), last_email.subject
end
end

0 comments on commit 0a81b21

Please sign in to comment.