Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Created April 12, 2013 08:15
Show Gist options
  • Save px-amaac/5370415 to your computer and use it in GitHub Desktop.
Save px-amaac/5370415 to your computer and use it in GitHub Desktop.
<p><%= @contact.message %></p>
<p>---------------------</p>
<p><%= ContactUs.require_name ? t('.sent_by_name', :email => @contact.email, :name => @contact.name) : t('.sent_by_contact_form', :email => @contact.email) %></p>
# Use this hook to configure contact mailer.
ContactUs.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which email notifications should be sent from. If emails must be sent from a verified email address you may set it here.
# Example:
# config.mailer_from = "contact@please-change-me.com"
config.mailer_from = nil
# Configure the e-mail address which should receive the contact form email notifications.
config.mailer_to = "xxxxxxxxxxx@xxxxxxx.xxx"
# ==> Form Configuration
# Configure the form to ask for the users name.
config.require_name = false
# Configure the form to ask for a subject.
config.require_subject = false
# Configure the form gem to use.
# Example:
# config.form_gem = 'formtastic
config.form_gem = 'formtastic'
end
<div class="panel">
<h2><%= t('.contact_us') %></h2>
<%= semantic_form_for @contact, :url => contacts_path do |f| %>
<%= f.input :name, :label => t('.name') if ContactUs.require_name %>
<%= f.input :email, :label => t('.email') %>
<%= f.input :subject, :label => t('.subject') if ContactUs.require_subject %>
<%= f.input :message, :as => :text, :label => t('.message') %>
<%= f.action :submit, :label => t('.submit'), :button_html => { :alt => t('.submit'), :id => 'contact_us_contact_submit', :title => t('.submit') } %>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment