Initial commit to the repo
[kwestie.git] / app / models / user_mailer.rb
blobb105a43c7a9f07571fe40954b0c8d76f85629365
1 class UserMailer < ActionMailer::Base
2   def signup_notification(user)
3     setup_email(user)
4     @subject    += 'Please activate your new account'
5   
6     @body[:url]  = "http://YOURSITE/activate/#{user.activation_code}"
7   
8   end
9   
10   def activation(user)
11     setup_email(user)
12     @subject    += 'Your account has been activated!'
13     @body[:url]  = "http://YOURSITE/"
14   end
15   
16   protected
17     def setup_email(user)
18       @recipients  = "#{user.email}"
19       @from        = "ADMINEMAIL"
20       @subject     = "[YOURSITE] "
21       @sent_on     = Time.now
22       @body[:user] = user
23     end
24 end