diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb index 0db00eeb..cf2c06ce 100644 --- a/app/helpers/conference_helper.rb +++ b/app/helpers/conference_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -DEFAULT_LOGO = Rails.configuration.conference[:default_logo] +DEFAULT_LOGO = Rails.configuration.conference[:default_logo_filename] DEFAULT_COLOR = Rails.configuration.conference[:default_color] module ConferenceHelper diff --git a/app/mailers/mailbot.rb b/app/mailers/mailbot.rb index 48eeca7c..33f3c010 100644 --- a/app/mailers/mailbot.rb +++ b/app/mailers/mailbot.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true +EMAIL_TEMPLATE = 'email_template' + SNAPCON_BCC_ADDRESS = Rails.configuration.mailbot[:bcc_address] -EMAIL_TEMPLATE = Rails.configuration.mailbot[:email_template] YTLF_TICKET_ID = Rails.configuration.mailbot[:ytlf_ticket_id] class Mailbot < ActionMailer::Base diff --git a/config/application.rb b/config/application.rb index d8a8930b..1f273e84 100644 --- a/config/application.rb +++ b/config/application.rb @@ -67,15 +67,13 @@ module Osem config.active_job.queue_adapter = :delayed_job config.conference = { - events_per_page: 3, - default_logo: 'snapcon_logo.png', - default_color: '#0B3559' + 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.mailbot = { - bcc_address: 'messages@snap.berkeley.edu', - email_template: 'email_template', - ytlf_ticket_id: 50 + ytlf_ticket_id: (ENV['YTLF_TICKET_ID'] || 50) } config.before_configuration do diff --git a/config/environments/development.rb b/config/environments/development.rb index 5b6263e3..474ed765 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -44,6 +44,11 @@ Osem::Application.configure do # Set the secret key base if it's not set via other means config.secret_key_base ||= 'f4be765bc98e516de82ac01daa8f8aa11c5ca13cb6c911887851ac89457b6c0b056b2361a21b5c08926c9386e0f91eef84fc0b103d522bf00bc0c78ea8ce7c58' + # Test email address + config.mailbot = { + 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..1f02f976 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -101,4 +101,9 @@ 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"] + + # Set bcc email address + config.mailbot = { + bcc_address: ENV['OSEM_MESSAGE_BCC_ADDRESS'] + } end diff --git a/config/environments/test.rb b/config/environments/test.rb index 1a9d4d7b..651ab938 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -53,4 +53,9 @@ Osem::Application.configure do end config.assets.precompile += ['mailbot.css'] + + # Test email address + config.mailbot = { + bcc_address: 'test@test.com' + } end