Class: FeedbackMailer

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

Instance Method Summary collapse

Instance Method Details

#feedback(host, to_address, options = {}) ⇒ Object

feedback(“findit.library.school.edu”, “[email protected]”,:name => “Joe”, :email => “[email protected]”, :feedback => “Whatever”, :umlaut_request => urequest)

* umlaut_request is optional


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/mailers/feedback_mailer.rb', line 8

def feedback(host, to_address, options = {})
  @host = host
  @umlaut_request = options[:umlaut_request]
  @name     = options[:name]
  @email    = options[:email]
  @feedback = options[:feedback]

  # Force permalink creation if we don't have one already
  if @umlaut_request && @umlaut_request.referent.permalinks.empty?
    permalink = Permalink.new_with_values!(@umlaut_request.referent, @umlaut_request.referrer_id)            
    @umlaut_request.referent.permalinks << permalink
    @umlaut_request.save!
  end

  mail(:to => to_address, :subject => "#{UmlautController.umlaut_config.app_name} Feedback: #{options[:name]}", :reply_to => @email)
end