The goal of this repository is to give students a place where they can learn about ActionMailer. There will be no lecture on this material before the homework. Students can use the ActionMailer guide to help them along. Students will bring questions to class the next day that we can answer for them.
- Fork and clone the repository
- Install gems using
bundle install
- Create and migrate the databases using
rake db:create:all db:migrate
- Run all of the specs using
rake spec
orrspec
Get all of the specs passing. If you get stuck, check out the solutions
branch
to help you along. Bring your questions to class the next day.
While you are doing development, you may want to be able to actually see the emails that are getting sent from your app. You can install the MailCatcher gem.
You can also need to add the following to your config/environment/development.rb file:
config.action_mailer.default_url_options = {host: "localhost:3000"}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {:address => "localhost", :port => 1025}
- Install the SendGrid add-on
- Add the following to your config/environment/production.rb file:
config.action_mailer.default_url_options = { host: "<the domain of your application>"}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}