Skip to content

Instantly share code, notes, and snippets.

@kalleth
Created January 4, 2012 12:42
Show Gist options
  • Save kalleth/1559880 to your computer and use it in GitHub Desktop.
Save kalleth/1559880 to your computer and use it in GitHub Desktop.
For Znow
# Contact Mailer
class Contact < ActionMailer::Base
#default :to => "contact@advicecapital.dk"
def contact(message, sender)
@message = message
@sender = sender
mail(
:from => sender,
:to => "znowm4n@gmail.com",
:subject => "[Contact AC]"
)
end
end
class ContactController < ApplicationController
def new
@message = Message.new
end
def create
if Contact.contact(params[:message], params[:email]).deliver
redirect_to root_path, :notice => "Din email blev sendt, vi kontakter dig."
else
render :new, :error => "Din email blev ikke sendt."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment