Set up the user activation.
[lyrix.git] / app / models / user_notifier.rb
blob8dff6716b2637675503c8a5b610c373ba45df0da
1 class UserNotifier < ActionMailer::Base
2   def signup_notification(user)
3     setup_email(user)
4     @subject    += 'Please activate your new account'
5   
6     @body[:url]  = "http://mylyrix.ath.cx/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://mylyrix.ath.cx/"
14   end
15   
16   protected
17     def setup_email(user)
18       @recipients  = "#{user.email}"
19       @from        = "donotreply@mylyrix.ath.cx"
20       @subject     = "[Lyrix] "
21       @sent_on     = Time.now
22       @body[:user] = user
23     end
24 end