Guest User

Untitled

a guest
Apr 24th, 2018
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. ## My action mailer
  2.  
  3. class Mailer < ActionMailer::Base
  4.  
  5. def contact_message(contact)
  6. @recipients = CONTACT_RECIPIENT
  7. @from = contact.email_address
  8. @subject = '[Scheppke.com] Contact Form Request'
  9. @body['name'] = contact.name
  10. @body['city'] = contact.city
  11. @body['state'] = contact.state
  12. @body['zip'] = contact.zip
  13. @body['phone'] = contact.phone
  14. @body['email'] = contact.email_address
  15. @body['address'] = contact.address
  16. @body['message'] = contact.message
  17. end
  18.  
  19. end
  20.  
  21.  
  22.  
  23. ## my form (contact.rhtml file)
  24.  
  25. <h1>Contact Us</h1>
  26.  
  27.  
  28. <%=error_messages_for "contact" %>
  29.  
  30. <%= start_form_tag :controller=>"info", :action=>"send_contact_request" %>
  31. Name <%= text_field("contact", "name") %>
  32. Email <%= text_field("contact", "email_address") %>
  33. Address <%= text_field("contact", "address") %>
  34. City <%= text_field("contact", "city") %>
  35. State <%= text_field("contact", "state", {"size"=>"5"}) %>
  36. Zip: <%= text_field("contact", "zip") %>
  37. Phone <%= text_field("contact", "phone") %>
  38. Message<br> <%= text_area("contact", "message") %>
  39. <%= submit_tag "Send" %>
  40. <%= end_form_tag %>
  41.  
  42.  
  43. ## yml file with server info
  44. development:
  45. email:
  46. server: mail.musikomputer.com
  47. port: 26
  48. domain: musikomputer.com
  49. authentication: plain
  50. username: eca+musikomputer.com
  51. password: imnottellingyou
  52. contact_recipient: jerzygangi@gmail.com
  53. production:
  54. email:
  55. server: mail.musikomputer.com
  56. port: 26
  57. domain: musikomputer.com
  58. authentication: login
  59. username: eca+musikomputer.com
  60. password: imnottellingyou
  61. contact_recipient: jerzygangi@gmail.com
Add Comment
Please, Sign In to add comment