Sha256: e9ed3f4973051e92ee5fc3456f6e071cbffedb7d95f6e6f4fe45463b48cbf5fd

Contents?: true

Size: 867 Bytes

Versions: 8

Compression:

Stored size: 867 Bytes

Contents

class ApplicationController < ActionController::Base
  append_view_path '.'

  def index
    render :template => 'index'
  end

  def send_mail
    ContactMailer.new_message(params[:email], params[:message], params[:attachment]).deliver
    redirect_to '/', :notice => 'Email sent successfully, please check letter_opener_web inbox.'
  end
end

class ContactMailer < ActionMailer::Base
  append_view_path File.dirname(__FILE__)

  default :to            => 'admin@letter_opener_web.com',
          :from          => 'no-reply@letter_opener_web.com',
          :template_path => '.'

  def new_message(from, message, attachment)
    @from, @message = from, message
    if attachment.present?
      attachments[attachment.original_filename] = attachment.tempfile.read
    end
    mail(:subject => 'Testing letter_opener_web', :template_name => 'new_message')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
letter_opener_web-1.2.0 demo/application_controller.rb
letter_opener_web-1.1.3 demo/application_controller.rb
letter_opener_web-1.1.2 demo/application_controller.rb
letter_opener_web-1.1.1 demo/application_controller.rb
letter_opener_web-1.1.0 demo/application_controller.rb
letter_opener_web-1.0.3 demo/application_controller.rb
letter_opener_web-1.0.2 demo/application_controller.rb
letter_opener_web-1.0.1 demo/application_controller.rb