Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix locales that require a 'host' variable #5273

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix subject locales that need a variable "host"
ozovalihasan committed Nov 26, 2024
commit d7ad69720538ae875d47d0da5c8fd6adcfe3e99c
6 changes: 3 additions & 3 deletions app/mailers/mailer.rb
Original file line number Diff line number Diff line change
@@ -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

4 changes: 2 additions & 2 deletions app/mailers/web_hooks_mailer.rb
Original file line number Diff line number Diff line change
@@ -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
@@ -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
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
@@ -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")