Class: PrayerMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/prayer_mailer.rb

Overview

The PrayerMailer emails users permalinks to their prayer requests.

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

Emails user permalink to their prayer request

Since:

  • 0.1.0


15
16
17
18
19
20
21
22
23
24
# File 'app/mailers/prayer_mailer.rb', line 15

def permalink_email(prayer)
  # Assign prayer to instance varaible so that we can pass it into the mailer view
  @prayer = prayer
  
  # Create url for prayer request
  @url  = prayer_url(@prayer.id)
  
  # Email user with content from mailer view located at app/views/prayer_mailer/permalink_email.text.erb
  mail(:to => @prayer.email.email, :subject => "Your Prayer Has Been Posted")
end