Closed suely closed 12 years ago
Are your rails application mailer settings configured? Perhaps I should mention that in the installation instructions as well. Please check your development or production environment file to make sure you have setup the ActionMailer settings. You can read more about the configuration within the Rails guides as well if you have any trouble: http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
my app/enviroments/development.rb is
Demoat::Application.configure do
config.cache_classes = false
config.whiny_nils = true
config.consider_all_requests_local = true config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smpt
config.active_support.deprecation = :log
config.action_dispatch.best_standards_support = :builtin
config.assets.compress = false
config.assets.debug = true end
Yea you will need to setup your applications mailer settings so that it knows how to send the emails. This is an issue with your application configuration and not ContactUs. Please refer to the guides link above for more detailed information. Or you may find any answers to your questions on Stackoverflow. Basically you will need to either setup sendmail or an smtp configuration to send any emails.
Personally I use MockSMTP app for testing development emails. Or you may try using Ryan Bates letter_opener instead for a free solution.
In production you will want to setup your ActionMailer configuration to use your hosting providers mailing solution, which is typically a SMTP relay.
Ok, I configured, now send mail to the "admin" BUT doesn't send mail to the user, I would like something like "thanks for you inquiry..." but the user don't get it, besides I can`t add more fields like
<%= f.input :name, :label => t('.name') %>
because I get this: undefined method `name' for #ContactUs::Contact:0x2b2f5d0
or change the message field by adding:
<%= f.input :message, :as => :text, :rows 5 :label => t('.message') %> because I want just 5 rows, not a textarea that big... I get: SyntaxError in Contact_us/contacts#new I now that Im doing something wrong...or missing something, and you are a busy man but please can you help me with this issue?
You will need to fork this repo and then point your Gemfile to your own fork of the project with the git option. Once you have your own fork of the repo setup you can make some of the modifications that you would like, such as, sending an email to the user and adding the name field. In order to add the name field you will need:
attr_accessor :name
added to the Contact model and a validator if desired. You would also then add to the Contact models save method the user email deliver call, and modify the mailer to have your user email method as well.
I don't plan to add those features to this library at least not at the moment as I intend to keep it as a bare minimum starting point for people to customize to their needs.
As for the rows on the message field I would recommend simply using CSS to style the form how you would like. Or you can double check how the formtastic syntax works, but I believe you would need to do:
<%= f.input :message, :as => :text, :label => t('.message'), :input_html => {:rows => 5} %>
I installed formtastic following the instrucctions:
1) gem 'formtastic' 2) Run the installation generator: 3) rails generate formtastic:install 4) gem 'contact_us', '~> 0.1.4' 5) bundle 6) bundle exec rake contact_us:install 7) modify my config.mailer_to = "lopez.suely@gmail.com"
but doesn`t work! Im Using rails 3.1...