Sha256: 9d7ac3a44b586705e57054cfe4d0cafefe6c62ee9591e47e814ef29c29590cc5

Contents?: true

Size: 1.01 KB

Versions: 22

Compression:

Stored size: 1.01 KB

Contents

class FeedbackMailer < ActionMailer::Base
  add_template_helper(EmailerHelper)

  default from: UmlautController.umlaut_config.from_email_addr

  # feedback("findit.library.school.edu", "librarian@university.edu",:name => "Joe", :email => "joe@gmail.com", :feedback => "Whatever", :umlaut_request => urequest)
  #   * umlaut_request is optional     
  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

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
umlaut-4.1.7 app/mailers/feedback_mailer.rb
umlaut-4.1.6 app/mailers/feedback_mailer.rb
umlaut-4.1.5 app/mailers/feedback_mailer.rb
umlaut-4.1.4 app/mailers/feedback_mailer.rb
umlaut-4.1.3 app/mailers/feedback_mailer.rb
umlaut-4.1.2 app/mailers/feedback_mailer.rb
umlaut-4.1.1 app/mailers/feedback_mailer.rb
umlaut-4.1.0 app/mailers/feedback_mailer.rb
umlaut-4.1.0.pre3 app/mailers/feedback_mailer.rb
umlaut-4.1.0.pre.2 app/mailers/feedback_mailer.rb
umlaut-4.1.0.pre.alpha.1 app/mailers/feedback_mailer.rb
umlaut-4.0.3 app/mailers/feedback_mailer.rb
umlaut-4.0.2 app/mailers/feedback_mailer.rb
umlaut-4.0.1 app/mailers/feedback_mailer.rb
umlaut-4.0.0 app/mailers/feedback_mailer.rb
umlaut-4.0.0.beta5 app/mailers/feedback_mailer.rb
umlaut-4.0.0.beta4 app/mailers/feedback_mailer.rb
umlaut-4.0.0.beta3 app/mailers/feedback_mailer.rb
umlaut-4.0.0.beta2 app/mailers/feedback_mailer.rb
umlaut-4.0.0.beta1 app/mailers/feedback_mailer.rb