Skip to content

Instantly share code, notes, and snippets.

View dan3lson's full-sized avatar

Danelson Rosa dan3lson

View GitHub Profile
@EliseFitz15
EliseFitz15 / action-mailer.md
Last active April 2, 2020 17:10
Action-Mailer-Clinic

Setting up ActionMailer in Rails

Action Mailer allows you to send emails from your application using mailer classes and views. Mailers work very similarly to controllers.

They inherit from ActionMailer::Base and live in app/mailers, and they have associated views that appear in app/views.

We are going to set up an e-mail to be delivered when a review is created for an item on our review site. To do this in a test driven way, we will start with the test.

###Start with a test & configuring our test environment

  • Let's look at this test - we check that the review content is displayed on the page and that we've successfully queued up an email to send.
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->