I started playing with the Mephisto contact form plugin written by James Crisp and added a very minor modification to allow users to edit the destination email address from the plugin configuration admin section.
mephisto_contact_form/lib/plugin.rb becomes
module Mephisto
module Plugins
class ContactForm < Mephisto::Plugin
author 'James Crisp'
version '0.1'
option :destination_email_address, "Enter your address here"
public_controller 'ContactForm', 'ContactForm'
add_route 'contact_form',
:controller => 'contact_form',
:action => 'contact_form'
add_route 'contact_submit',
:controller => 'contact_form',
:action => 'contact_submit',
:conditions => { :method => :post }
end
end
end
and mephisto_contact_form/lib/contact_notifier.rb becomes
class ContactNotifier < ActionMailer::Base
include Mephisto::Liquid::UrlMethods
self.template_root = File.dirname(__FILE__) + '/views'
def contact_notification(contact_message)
recipients Mephisto::Plugin['ContactForm'].options['destination_email_address']
from contact_message.author_email
subject "[Mephisto Contact Form] #{contact_message.subject}"
body "contact_message" => contact_message
end
end
Post new comment