Skip to content

Commit

Permalink
chore: set mailer 'from', which may differ from username
Browse files Browse the repository at this point in the history
  • Loading branch information
pdl committed Nov 7, 2024
1 parent b84d303 commit a5c3427
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: ENV["MAILER_USERNAME"]
default from: ENV["MAILER_FROM"]
layout 'mailer'
end
5 changes: 5 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
password: ENV["MAILER_PASSWORD"]
}

config.action_mailer.default_options = {
from: mailer_credentials[:from],
reply_to: mailer_credentials[:from]
}

# 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.
# config.action_mailer.raise_delivery_errors = false
Expand Down
5 changes: 5 additions & 0 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
password: ENV["MAILER_PASSWORD"]
}

config.action_mailer.default_options = {
from: mailer_credentials[:from],
reply_to: mailer_credentials[:from]
}

# 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.
# config.action_mailer.raise_delivery_errors = false
Expand Down

0 comments on commit a5c3427

Please sign in to comment.