Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes issue #344-mailer #360

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ APP_PORTFOLIO_PRODUCTION_MAILER_URL=localhost:3000
#reCaptcha settings
APP_PORTFOLIO_reCAPTCHA_SITE_KEY=""
APP_PORTFOLIO_reCAPTCHA_SECRET_KEY=""

#mailer settings
MAIL_SMTP_ADDRESS='localhost'
3 changes: 3 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ APP_PORTFOLIO_DATABASE_TIMEOUT=5000
APP_PORTFOLIO_DATABASE_USERNAME=

APP_PORTFOLIO_PRODUCTION_MAILER_URL=localhost:3000

#mailer settings
MAIL_SMTP_ADDRESS='localhost'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ gem 'rails-controller-testing'
# Use rubocop for static code analysis
gem 'rubocop'
# bundler audit
gem 'rexml', '>= 3.2.7'
gem 'rexml', '>= 3.3.2'
gem 'rubocop-rails', require: false

gem 'rubocop-rspec', require: false
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.1)
rexml (3.3.2)
strscan
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -432,7 +432,7 @@ DEPENDENCIES
rails-controller-testing
rb-readline
recaptcha
rexml (>= 3.2.7)
rexml (>= 3.3.2)
rspec-rails (~> 4.1.0)
rspec_junit_formatter
rubocop
Expand Down
19 changes: 14 additions & 5 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,24 @@
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "application_portfolio_#{Rails.env}"

# Configure Secure Sendmail mailer
config.action_mailer.raise_delivery_errors = true

config.action_mailer.perform_caching = false
config.action_mailer.default_options = { from: 'uclappdev@uc.edu' }
config.mailer_from = 'uclappdev@uc.edu'
config.action_mailer.delivery_method = :smtp
# Store the base url from where request is received.
config.action_mailer.default_url_options = { host: ENV['APP_PORTFOLIO_PRODUCTION_MAILER_URL'] }
# updated for tls and sendmail
config.action_mailer.smtp_settings = {
enable_starttls_auto: true,
# 'address' specifies the address of the server that will handle email sending.
address: ENV['MAIL_SMTP_ADDRESS'],
# 'port' specifies which port to use on the SMTP server.
port: 25,
# 'ca_file' is the path to the certificate authority file.
# In our case, it's a self-signed certificate. This tells Rails to trust this specific certificate.
ca_file: '/etc/ssl/certs/sendmail.pem'
}

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
Expand Down Expand Up @@ -99,9 +111,6 @@
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Needed for mail to work in production
config.action_mailer.smtp_settings = { enable_starttls_auto: false }

# Change the Uglifier parsing engine
config.assets.js_compressor = Uglifier.new(harmony: true)
end
Loading