mirror of
https://github.com/edcommonwealth/ecp.org.git
synced 2026-03-09 07:28:16 -07:00
Swap out contact form to one that uses mailgun
This commit is contained in:
parent
6df92d6f88
commit
7f433cf223
17 changed files with 130 additions and 70 deletions
16
app/controllers/contacts_controller.rb
Normal file
16
app/controllers/contacts_controller.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class ContactsController < ApplicationController
|
||||
def new
|
||||
@contact = Contact.new
|
||||
end
|
||||
|
||||
def create
|
||||
@contact = Contact.new(params[:contact])
|
||||
@contact.request = request
|
||||
if @contact.deliver
|
||||
flash.now[:success] = 'Message sent!'
|
||||
else
|
||||
flash.now[:error] = 'Could not send message'
|
||||
render :new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,2 +1,5 @@
|
|||
class HomeController < ApplicationController
|
||||
def index
|
||||
@contact = Contact.new
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue