Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Using MailCatcher

Tim Morgan edited this page Sep 30, 2015 · 2 revisions

Testing text and html email while hacking on OneBody is easy... just use MailCatcher!

Depending on how you set up OneBody for development, follow the instructions in one of the sections below:

I'm using Vagrant

  1. vagrant ssh
  2. Add SetEnv MAILCATCHER true to your apache config file in /etc/apache2/sites-available/onebody.conf
  3. service apache2 restart
  4. cd /vagrant
  5. gem install mailcatcher
  6. Add config.vm.network :forwarded_port, host: 1080, guest: 1080 to your Vagrantfile.local file (create the file if it doesn't exist), then restart the vm with vagrant reload.
  7. Run mailcatcher --ip=0.0.0.0 inside the vm.
  8. View MailCatcher in a web browser http://localhost:1080
  9. Send email from OneBody and see it in MailCatcher!

I'm developing on my machine directly

  1. gem install mailcatcher
  2. mailcatcher
  3. Set the environment variable when starting Rails: MAILCATCHER=true rails server
  4. View MailCatcher in a web browser http://localhost:1080
  5. Send email from OneBody and see it in MailCatcher!