20170529000002_setting_delivery_permanent_failed.rb 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. class SettingDeliveryPermanentFailed < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. setting = Setting.find_by(name: '0900_postmaster_filter_bounce_check')
  6. if setting
  7. setting.name = '0900_postmaster_filter_bounce_follow_up_check'
  8. setting.state = 'Channel::Filter::BounceFollowUpCheck'
  9. setting.save!
  10. else
  11. Setting.create_if_not_exists(
  12. title: 'Defines postmaster filter.',
  13. name: '0900_postmaster_filter_bounce_follow_up_check',
  14. area: 'Postmaster::PreFilter',
  15. description: 'Defines postmaster filter to identify postmaster bounced - to handle it as follow-up of the original ticket.',
  16. options: {},
  17. state: 'Channel::Filter::BounceFollowUpCheck',
  18. frontend: false
  19. )
  20. end
  21. Setting.create_if_not_exists(
  22. title: 'Defines postmaster filter.',
  23. name: '0950_postmaster_filter_bounce_delivery_permanent_failed',
  24. area: 'Postmaster::PreFilter',
  25. description: 'Defines postmaster filter to identify postmaster bounced - disable sending notification on permanent deleivery failed.',
  26. options: {},
  27. state: 'Channel::Filter::BounceDeliveryPermanentFailed',
  28. frontend: false
  29. )
  30. end
  31. end