diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index ddb2e506..35e6b709 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -EVENTS_PER_PAGE = 3 +EVENTS_PER_PAGE = Rails.configuration.conference[:events_per_page] class ConferencesController < ApplicationController include ConferenceHelper diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb index c392a814..cf2c06ce 100644 --- a/app/helpers/conference_helper.rb +++ b/app/helpers/conference_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -DEFAULT_LOGO = 'snapcon_logo.png' -DEFAULT_COLOR = '#0B3559' +DEFAULT_LOGO = Rails.configuration.conference[:default_logo_filename] +DEFAULT_COLOR = Rails.configuration.conference[:default_color] module ConferenceHelper # Return true if only call_for_papers or call_for_tracks or call_for_booths is open diff --git a/app/mailers/mailbot.rb b/app/mailers/mailbot.rb index 2f9d1f77..33f3c010 100644 --- a/app/mailers/mailbot.rb +++ b/app/mailers/mailbot.rb @@ -1,8 +1,9 @@ # frozen_string_literal: true -SNAPCON_BCC_ADDRESS = 'messages@snap.berkeley.edu' EMAIL_TEMPLATE = 'email_template' -YTLF_TICKET_ID = 50 + +SNAPCON_BCC_ADDRESS = Rails.configuration.mailbot[:bcc_address] +YTLF_TICKET_ID = Rails.configuration.mailbot[:ytlf_ticket_id] class Mailbot < ActionMailer::Base helper ConferenceHelper diff --git a/config/application.rb b/config/application.rb index 18f917aa..4e5e9b87 100644 --- a/config/application.rb +++ b/config/application.rb @@ -66,6 +66,12 @@ module Osem config.active_job.queue_adapter = :delayed_job + config.conference = { + events_per_page: (ENV['EVENTS_PER_PAGE'] || 3), + default_logo_filename: (ENV['DEFAULT_LOGO_FILENAME'] || 'snapcon_logo.png'), + default_color: (ENV['DEFAULT_COLOR'] || '#0B3559') + } + config.before_configuration do env_file = File.join(Rails.root, 'config', 'local_env.yml') if File.exist?(env_file) diff --git a/config/environments/development.rb b/config/environments/development.rb index 78949098..34766ec9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -44,6 +44,12 @@ Osem::Application.configure do # Set the secret key base if it's not set via other means config.secret_key_base ||= 'f4be765bc98e516de82ac01daa8f8aa11c5ca13cb6c911887851ac89457b6c0b056b2361a21b5c08926c9386e0f91eef84fc0b103d522bf00bc0c78ea8ce7c58' + # Test mailbot settings + config.mailbot = { + ytlf_ticket_id: 50, + bcc_address: 'test@test.com' + } + # Use omniauth mock credentials OmniAuth.config.test_mode = true diff --git a/config/environments/production.rb b/config/environments/production.rb index d41774af..fd6b8a90 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -101,4 +101,10 @@ Osem::Application.configure do # Set the secret_key_base from the env, if not set by any other means config.secret_key_base ||= ENV["SECRET_KEY_BASE"] + + # Mailbot settings + config.mailbot = { + ytlf_ticket_id: (ENV['YTLF_TICKET_ID'] || 50), + bcc_address: ENV['OSEM_MESSAGE_BCC_ADDRESS'] + } end diff --git a/config/environments/test.rb b/config/environments/test.rb index 53071a55..9076d8e6 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -51,4 +51,10 @@ Osem::Application.configure do Timecop.travel(t) ActiveSupport::Deprecation.silenced = true end + + # Test mailbot settings + config.mailbot = { + ytlf_ticket_id: 50, + bcc_address: 'test@test.com' + } end