20171123000001_email_process_customer_selection_based_on_sender_recipient.rb 940 B

12345678910111213141516171819202122232425262728293031323334
  1. class EmailProcessCustomerSelectionBasedOnSenderRecipient < 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.create_if_not_exists(
  6. title: 'Customer selection based on sender and receiver list',
  7. name: 'postmaster_sender_is_agent_search_for_customer',
  8. area: 'Email::Base',
  9. description: 'If the sender is an agent, set the first user in the recipient list as a customer.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: true,
  15. name: 'postmaster_sender_is_agent_search_for_customer',
  16. tag: 'boolean',
  17. options: {
  18. true => 'yes',
  19. false => 'no',
  20. },
  21. },
  22. ],
  23. },
  24. state: true,
  25. preferences: {
  26. permission: ['admin.channel_email'],
  27. },
  28. frontend: false
  29. )
  30. end
  31. end