diff --git a/app/models/account.rb b/app/models/account.rb index 52d09ba3..c37fe799 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -81,7 +81,7 @@ class Account < ApplicationRecord return if ENV['CAREERPLUG_WEBHOOK_SECRET'].blank? webhook_urls.create!( - url: 'https://www.careerplug.com/api/docuseal/events', + url: ENV.fetch('CAREERPLUG_WEBHOOK_URL', 'https://www.careerplug.com/api/docuseal/events'), events: %w[form.viewed form.started form.completed form.declined], secret: { 'X-CareerPlug-Secret' => ENV.fetch('CAREERPLUG_WEBHOOK_SECRET') } ) diff --git a/config/dotenv.rb b/config/dotenv.rb index 110119c0..ee98368c 100644 --- a/config/dotenv.rb +++ b/config/dotenv.rb @@ -1,5 +1,10 @@ # frozen_string_literal: true +if ENV['RAILS_ENV'] == 'development' + require 'dotenv' + Dotenv.load('.env') +end + if ENV['RAILS_ENV'] == 'production' || ENV['RAILS_ENV'] == 'staging' if !ENV['AWS_SECRET_MANAGER_ID'].to_s.empty? require 'aws-sdk-secretsmanager'