changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/restful_authentication/generators/authenticated/templates/mailer.rb

changeset 4: 43c5e6930eee
author: moriq@moriq.com
date: Wed Mar 05 01:17:41 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugin restful_authentication.
1class <%= 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
25end