From cfea9cc172fcce5deeafeb4f6f5eba85f7827e96 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 26 Mar 2024 15:45:19 +0100 Subject: [PATCH] Add list of pending releases directly in mail notifications for version updates (#29436) --- app/mailers/admin_mailer.rb | 4 ++++ app/views/admin_mailer/new_critical_software_updates.text.erb | 4 ++++ app/views/admin_mailer/new_software_updates.text.erb | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb index 8990b2a847..8dd7b6e59f 100644 --- a/app/mailers/admin_mailer.rb +++ b/app/mailers/admin_mailer.rb @@ -46,12 +46,16 @@ class AdminMailer < ApplicationMailer end def new_software_updates + @software_updates = SoftwareUpdate.all.to_a.sort_by(&:gem_version) + locale_for_account(@me) do mail subject: default_i18n_subject(instance: @instance) end end def new_critical_software_updates + @software_updates = SoftwareUpdate.where(urgent: true).to_a.sort_by(&:gem_version) + headers['Priority'] = 'urgent' headers['X-Priority'] = '1' headers['Importance'] = 'high' diff --git a/app/views/admin_mailer/new_critical_software_updates.text.erb b/app/views/admin_mailer/new_critical_software_updates.text.erb index 63c170dc0d..e4886c2621 100644 --- a/app/views/admin_mailer/new_critical_software_updates.text.erb +++ b/app/views/admin_mailer/new_critical_software_updates.text.erb @@ -1,3 +1,7 @@ <%= raw t('admin_mailer.new_critical_software_updates.body') %> +<% @software_updates.each do |update| %> +- Mastodon #{update.version}: #{update.release_notes} +<% end %> + <%= raw t('application_mailer.view')%> <%= admin_software_updates_url %> diff --git a/app/views/admin_mailer/new_software_updates.text.erb b/app/views/admin_mailer/new_software_updates.text.erb index 96808f3cb3..7612b7c59f 100644 --- a/app/views/admin_mailer/new_software_updates.text.erb +++ b/app/views/admin_mailer/new_software_updates.text.erb @@ -1,3 +1,7 @@ <%= raw t('admin_mailer.new_software_updates.body') %> +<% @software_updates.each do |update| %> +- Mastodon #{update.version}: #{update.release_notes} +<% end %> + <%= raw t('application_mailer.view')%> <%= admin_software_updates_url %>