Initial commit to the repo
[kwestie.git] / vendor / plugins / restful_authentication / generators / authenticated / templates / mailer.rb
blobf6e092b2d871c0759b3e4eb01f1a6df2450a406d
1 class <%= class_name %>Mailer < ActionMailer::Base
2   def signup_notification(<%= file_name %>)
3     setup_email(<%= file_name %>)
4     @subject    += 'Please activate your new account'
5   <% if options[:include_activation] %>
6     @body[:url]  = "http://YOURSITE/activate/#{<%= file_name %>.activation_code}"
7   <% else %>
8     @body[:url]  = "http://YOURSITE/login/" <% end %>
9   end
10   
11   def activation(<%= file_name %>)
12     setup_email(<%= file_name %>)
13     @subject    += 'Your account has been activated!'
14     @body[:url]  = "http://YOURSITE/"
15   end
16   
17   protected
18     def setup_email(<%= file_name %>)
19       @recipients  = "#{<%= file_name %>.email}"
20       @from        = "ADMINEMAIL"
21       @subject     = "[YOURSITE] "
22       @sent_on     = Time.now
23       @body[:<%= file_name %>] = <%= file_name %>
24     end
25 end