20210816125040_rename_notification_sender.rb 730 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class RenameNotificationSender < ActiveRecord::Migration[6.0]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. setting = Setting.find_by(
  7. name: 'notification_sender',
  8. )
  9. return if !setting
  10. # rubocop:disable Lint/InterpolationCheck
  11. setting.state_initial[:value] = '#{config.product_name} <noreply@#{config.fqdn}>'
  12. if setting.state_current[:value].eql? 'Notification Master <noreply@#{config.fqdn}>'
  13. setting.state_current[:value] = '#{config.product_name} <noreply@#{config.fqdn}>'
  14. end
  15. # rubocop:enable Lint/InterpolationCheck
  16. setting.save!
  17. end
  18. end