Skip to content

Commit

Permalink
Setting MailCatcher as the default Mail setup for the development env…
Browse files Browse the repository at this point in the history
…ironment (#872)

* Setting MailCatcher as the default Mail setup for the development environment

Co-authored-by: carolyncole <1599081+carolyncole@users.noreply.github.com>

* Ensuring that Mailcatcher is specified within the `development` dependencies

Co-authored-by: carolyncole <1599081+carolyncole@users.noreply.github.com>
  • Loading branch information
jrgriffiniii and carolyncole committed Jan 19, 2023
1 parent 687b083 commit e2d7383
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ group :development do
gem "capistrano-passenger", require: false
gem "capistrano-rails", "~> 1.4", require: false
gem "foreman"
gem "mailcatcher"
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem "web-console", ">= 4.1.0"
# Display performance information such as SQL time and flame graphs for each request in your browser.
Expand Down
32 changes: 32 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
daemons (1.4.1)
database_cleaner-active_record (2.0.1)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
Expand Down Expand Up @@ -188,6 +189,7 @@ GEM
equivalent-xml (0.6.0)
nokogiri (>= 1.4.3)
erubi (1.11.0)
eventmachine (1.2.7)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
Expand All @@ -204,6 +206,10 @@ GEM
activerecord (>= 4.0.0)
globalid (1.0.1)
activesupport (>= 5.0)
haml (6.1.1)
temple (>= 0.8.2)
thor
tilt
hashdiff (1.0.1)
hashie (3.6.0)
honeybadger (4.12.1)
Expand All @@ -215,6 +221,7 @@ GEM
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jmespath (1.6.1)
json (2.6.3)
json_schema (0.21.0)
kramdown (2.4.0)
rexml
Expand All @@ -226,6 +233,16 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
mailcatcher (0.2.4)
eventmachine
haml
i18n
json
mail
sinatra
skinny (>= 0.1.2)
sqlite3-ruby
thin
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
Expand Down Expand Up @@ -394,6 +411,9 @@ GEM
rack (~> 2.2)
rack-protection (= 2.2.3)
tilt (~> 2.0)
skinny (0.2.2)
eventmachine (~> 1.0)
thin
spring (4.0.0)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
Expand All @@ -402,12 +422,23 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.6.0)
mini_portile2 (~> 2.8.0)
sqlite3 (1.6.0-x86_64-darwin)
sqlite3 (1.6.0-x86_64-linux)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
sync (0.5.0)
temple (0.9.1)
term-ansicolor (1.7.1)
tins (~> 1.0)
thin (1.8.1)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.11)
Expand Down Expand Up @@ -495,6 +526,7 @@ DEPENDENCIES
jbuilder (~> 2.7)
kramdown
listen (~> 3.3)
mailcatcher
net-smtp
nokogiri (>= 1.13.4)
omniauth-cas
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ We use DataCite to mint DOIs and in production you must to define the `DATACITE_
RDSS uses the same [release and deployment process](https://github.com/pulibrary/rdss-handbook/blob/main/release_process.md) for all projects.

## Mail

### Mail on Development
Mailcatcher is a gem that can also be installed locally. See the [mailcatcher documentation](https://mailcatcher.me/) for how to run it on your machine.

### Mail on Staging
To See mail that has been sent on the staging server you must ssh tunnel into the server. Since there are two staging servers, the mail could have been sent on either machine. You may have to check both and will need two terminals.

Expand Down
9 changes: 6 additions & 3 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :amazon

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

config.action_mailer.perform_caching = false

config.action_mailer.default_options = {
from: "noreply@example.com"
}

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "localhost",
port: 1025
}

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

Expand Down

0 comments on commit e2d7383

Please sign in to comment.