20170525000001_reply_to_sender_feature.rb 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class ReplyToSenderFeature < ActiveRecord::Migration[4.2]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_if_not_exists(
  7. title: 'Sender based on Reply-To header',
  8. name: 'postmaster_sender_based_on_reply_to',
  9. area: 'Email::Base',
  10. description: 'Set/overwrite sender/from of email based on reply-to header. Useful to set correct customer if email is received from a third party system on behalf of a customer.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'postmaster_sender_based_on_reply_to',
  17. tag: 'select',
  18. options: {
  19. '' => '-',
  20. 'as_sender_of_email' => 'Take reply-to header as sender/from of email.',
  21. 'as_sender_of_email_use_from_realname' => 'Take reply-to header as sender/from of email and use realname of origin from.',
  22. },
  23. },
  24. ],
  25. },
  26. state: '',
  27. preferences: {
  28. permission: ['admin.channel_email'],
  29. },
  30. frontend: false
  31. )
  32. Setting.create_if_not_exists(
  33. title: 'Defines postmaster filter.',
  34. name: '0011_postmaster_sender_based_on_reply_to',
  35. area: 'Postmaster::PreFilter',
  36. description: 'Defines postmaster filter to set the sender/from of emails based on reply-to header.',
  37. options: {},
  38. state: 'Channel::Filter::ReplyToBasedSender',
  39. frontend: false
  40. )
  41. end
  42. end