EDITOR=vim rails credentials:edit
development:
mailtrap:
user_name: your_mailtrap_user_name
password: your_mailtrap_password
address: your_mailtrap_address
domain: your_mailtrap_domain
port: your_mailtrap_port
test:
mailtrap:
user_name: your_mailtrap_user_name
password: your_mailtrap_password
address: your_mailtrap_address
domain: your_mailtrap_domain
port: your_mailtrap_port
vim config/environments/development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
user_name: Rails.application.credentials[:development][:mailtrap][:user_name],
password: Rails.application.credentials[:development][:mailtrap][:password],
address: Rails.application.credentials[:development][:mailtrap][:address],
domain: Rails.application.credentials[:development][:mailtrap][:domain],
port: Rails.application.credentials[:development][:mailtrap][:port],
authentication: :cram_md5
}
vim config/environments/test.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
user_name: Rails.application.credentials[:test][:mailtrap][:user_name],
password: Rails.application.credentials[:test][:mailtrap][:password],
address: Rails.application.credentials[:test][:mailtrap][:address],
domain: Rails.application.credentials[:test][:mailtrap][:domain],
port: Rails.application.credentials[:test][:mailtrap][:port],
authentication: :cram_md5
}