Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## My action mailer
- class Mailer < ActionMailer::Base
- def contact_message(contact)
- @recipients = CONTACT_RECIPIENT
- @from = contact.email_address
- @subject = '[Scheppke.com] Contact Form Request'
- @body['name'] = contact.name
- @body['city'] = contact.city
- @body['state'] = contact.state
- @body['zip'] = contact.zip
- @body['phone'] = contact.phone
- @body['email'] = contact.email_address
- @body['address'] = contact.address
- @body['message'] = contact.message
- end
- end
- ## my form (contact.rhtml file)
- <h1>Contact Us</h1>
- <%=error_messages_for "contact" %>
- <%= start_form_tag :controller=>"info", :action=>"send_contact_request" %>
- Name <%= text_field("contact", "name") %>
- Email <%= text_field("contact", "email_address") %>
- Address <%= text_field("contact", "address") %>
- City <%= text_field("contact", "city") %>
- State <%= text_field("contact", "state", {"size"=>"5"}) %>
- Zip: <%= text_field("contact", "zip") %>
- Phone <%= text_field("contact", "phone") %>
- Message<br> <%= text_area("contact", "message") %>
- <%= submit_tag "Send" %>
- <%= end_form_tag %>
- ## yml file with server info
- development:
- email:
- server: mail.musikomputer.com
- port: 26
- domain: musikomputer.com
- authentication: plain
- username: eca+musikomputer.com
- password: imnottellingyou
- contact_recipient: jerzygangi@gmail.com
- production:
- email:
- server: mail.musikomputer.com
- port: 26
- domain: musikomputer.com
- authentication: login
- username: eca+musikomputer.com
- password: imnottellingyou
- contact_recipient: jerzygangi@gmail.com
Add Comment
Please, Sign In to add comment