A website template with lots of features, built with ruby on rails.

user_mailer.rb 1.0KB

12345678910111213141516171819202122232425262728293031
  1. class UserMailer < ActionMailer::Base
  2. default from: "contact@website.com"
  3. def signup_message(email)
  4. config = Info.first
  5. mail :to => email,
  6. :subject => ("Welcome to "+ config.website_name),
  7. :from => config.contact_email,
  8. :from_name => config.website_name,
  9. :body => "Thanks for registering to our website."
  10. end
  11. def contact_message(contact_message, to_address)
  12. @msg = contact_message
  13. mail :to => to_address,
  14. :subject => @msg.title,
  15. :from => @msg.user == nil ? @msg.email : @msg.user.email,
  16. :from_name => @msg.user != nil ? @msg.user.full_name : @msg.email,
  17. :body => @msg.content
  18. end
  19. def newsletter_subscription(subscription)
  20. config = Info.first
  21. mail :to => subscription.email,
  22. :subject => (t 'newsletter_subscription.subject'),
  23. :from => config.contact_email,
  24. :from_name => config.website_name,
  25. :body => (t 'newsletter_subscription.message')
  26. end
  27. end