Skip to content

Commit 67a4c9e

Browse files
committed
Fix issues with dev environment mail setup
* Emails werent sent because of missing from address * Prod-like mode didn't run solidqueue * letteropener can't open a browser within docker, using letteropener_web instead
1 parent 13d1469 commit 67a4c9e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

config/environments/development.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
config.active_storage.service = :local
3333

3434
# Mailer setup for development
35-
config.action_mailer.raise_delivery_errors = false
35+
# Surface mail delivery errors locally so broken configuration (e.g., missing From) is obvious.
36+
config.action_mailer.raise_delivery_errors = true
3637
config.action_mailer.perform_caching = false
3738
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
38-
config.action_mailer.delivery_method = :letter_opener
39+
config.action_mailer.default_options = { from: ENV.fetch("MAIL_FROM", "noreply@hackorum.dev") }
40+
# Use the web UI for viewing emails to avoid Launchy/browser dependencies inside containers.
41+
config.action_mailer.delivery_method = :letter_opener_web
3942

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

docker-compose.dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ services:
3636
PGUSER: ${POSTGRES_USER:-hackorum}
3737
PGPASSWORD: ${POSTGRES_PASSWORD:-hackorum}
3838
PGDATABASE: ${POSTGRES_DB:-hackorum_development}
39+
SOLID_QUEUE_IN_PUMA: "1"
3940
FORCE_SSL: ${FORCE_SSL:-false}
4041
volumes:
4142
- .:/app

0 commit comments

Comments
 (0)