Add list of pending releases directly in mail notifications for version updates (#29436)

main-rebase-security-fix
Claire 2024-03-26 15:45:19 +01:00 committed by GitHub
parent 32938dadd7
commit cfea9cc172
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -46,12 +46,16 @@ class AdminMailer < ApplicationMailer
end end
def new_software_updates def new_software_updates
@software_updates = SoftwareUpdate.all.to_a.sort_by(&:gem_version)
locale_for_account(@me) do locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance) mail subject: default_i18n_subject(instance: @instance)
end end
end end
def new_critical_software_updates def new_critical_software_updates
@software_updates = SoftwareUpdate.where(urgent: true).to_a.sort_by(&:gem_version)
headers['Priority'] = 'urgent' headers['Priority'] = 'urgent'
headers['X-Priority'] = '1' headers['X-Priority'] = '1'
headers['Importance'] = 'high' headers['Importance'] = 'high'

View File

@ -1,3 +1,7 @@
<%= raw t('admin_mailer.new_critical_software_updates.body') %> <%= 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 %> <%= raw t('application_mailer.view')%> <%= admin_software_updates_url %>

View File

@ -1,3 +1,7 @@
<%= raw t('admin_mailer.new_software_updates.body') %> <%= 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 %> <%= raw t('application_mailer.view')%> <%= admin_software_updates_url %>