"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20170525000001_reply_to_sender_feature.rb" (25 Mar 2021, 1641 Bytes) of package /linux/www/zammad-4.0.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "20170525000001_reply_to_sender_feature.rb": 3.4.1_vs_3.5.0.

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