After an email has been delivered, the entire content of the email is visible in the logs in production, which is really messy. Can I remove the email content from the logs just in production?
Action Mailer is the Rails component that enables applications to send and receive emails. In this chapter, we will see how to send an email using Rails. Let's start creating an emails project using the following command. tp> rails new mailtest. This will create the required framework to proceed.
Then the preview will be available in http://localhost:3000/rails/mailers/user_mailer/welcome_email. If you change something in app/views/user_mailer/welcome_email. html. erb or the mailer itself, it'll automatically reload and render it so you can visually see the new style instantly.
ActionMailer::Base.logger = nil
or in your config/environments/{development,test,production}.rb, add :
Rails.application.configure do
...
config.action_mailer.logger = nil
...
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With