Use this code snippet when you need to see the generated HTML by active mailer in the browser.
rails runner 'puts MyMailer.welcome_email("email@email.com", "Subject").body.to_s' | \
  awk '/<!DOCTYPE.*/,EOF' > test.html && \
  xdg-open test.html
- MyMailer.welcome_emailand its parameters should be changed to match your code
- Read about Action Mailer if you're not already familiar with
- awkcommand is used to omit the Rails- runnerlogs
- Replace xdg-openwithopenin MacOS