Sha256: 37be2ea664d99a69f27fc0544e2b88541a6b0240d097cb39822b6f5932ce1fde

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents

User.as(::User.anonymous_api_admin.login) do
  N_('Patch Window Results')

  notifications = [
    {
      name: :patch_group_initiated,
      description: N_('Notification that a patch group is about to start patching'),
      mailer: 'ForemanPatch::GroupMailer',
      method: 'initiated',
      subscription_type: 'alert',
    },
    {
      name: :patch_group_completed,
      description: N_('Notification that a patch group has completed patching'),
      mailer: 'ForemanPatch::GroupMailer',
      method: 'completed',
      subscription_type: 'alert',
    },
    {
      name: :patch_invocation_failure,
      description: N_('Notification of an error in the host patching process'),
      mailer: 'ForemanPatch::InvocationMailer',
      method: 'failure',
      subscription_type: 'alert',
    },
    {
      name: :patch_cycle_planned,
      description: N_('Notification on the creation of a new patch cycle'),
      mailer: 'ForemanPatch::CycleMailer',
      method: 'planned',
      subscription_type: 'alert',
    }
  ]

  notifications.each do |notification|
    ::MailNotification.where(name: notification[:name]).first_or_create!(notification)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_patch-1.2.0.alpha1 db/seeds.d/160-mail_notifications.rb
foreman_patch-1.1.6.alpha5 db/seeds.d/160-mail_notifications.rb
foreman_patch-1.1.6.alpha4 db/seeds.d/160-mail_notifications.rb
foreman_patch-1.1.5 db/seeds.d/160-mail_notifications.rb
foreman_patch-1.1.4 db/seeds.d/160-mail_notifications.rb
foreman_patch-1.1.3 db/seeds.d/160-mail_notifications.rb
foreman_patch-1.1.1 db/seeds.d/160-mail_notifications.rb