Skip to content

Commit

Permalink
Add email development config
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Chakroun committed Jul 31, 2019
1 parent 16f9338 commit 53a52d9
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,23 @@
#Devise
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

# ActionMailer::Base.smtp_settings = {
# user_name: ENV["SENDGRID_USERNAME"],
# password: ENV["SENDGRID_PASSWORD"],
# domain: "em1678.mail.chakroun.eu",
# address: "smtp.sendgrid.net",
# port: 587,
# authentication: :plain,
# enable_starttls_auto: true
# }
if ENV["ENABLE_DEV_EMAILS"] == "true"
ActionMailer::Base.smtp_settings = {
user_name: ENV["SENDGRID_USERNAME"],
password: ENV["SENDGRID_PASSWORD"],
domain: "em1678.mail.chakroun.eu",
address: "smtp.sendgrid.net",
port: 587,
authentication: :plain,
enable_starttls_auto: true
}
end
class SandboxEmailInterceptor
def self.delivering_email(message)
message.to = [ENV["DEVELOPER_EMAIL"]]
end
end
ActionMailer::Base.register_interceptor(SandboxEmailInterceptor)

config.backup_with_callback = true

Expand Down

0 comments on commit 53a52d9

Please sign in to comment.