Swap out contact form to one that uses mailgun

This commit is contained in:
rebuilt 2022-11-01 15:51:16 -07:00
parent 6df92d6f88
commit 7f433cf223
17 changed files with 130 additions and 70 deletions

View 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

View file

@ -1,2 +1,5 @@
class HomeController < ApplicationController
def index
@contact = Contact.new
end
end