public
Description: Generates common user authentication code for Rails/Merb, with a full test/unit and rspec suite and optional Acts as State Machine support built-in.
Homepage: http://weblog.techno-weenie.net
Clone URL: git://github.com/technoweenie/restful-authentication.git
Click here to lend your support to: restful-authentication and make a donation at www.pledgie.com !
100644 26 lines (23 sloc) 0.811 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class <%= class_name %>Mailer < ActionMailer::Base
def signup_notification(<%= file_name %>)
setup_email(<%= file_name %>)
@subject += 'Please activate your new account'
<% if options[:include_activation] %>
@body[:url] = "http://YOURSITE/activate/#{<%= file_name %>.activation_code}"
<% else %>
@body[:url] = "http://YOURSITE/login/" <% end %>
end
def activation(<%= file_name %>)
setup_email(<%= file_name %>)
@subject += 'Your account has been activated!'
@body[:url] = "http://YOURSITE/"
end
protected
def setup_email(<%= file_name %>)
@recipients = "#{<%= file_name %>.email}"
@from = "ADMINEMAIL"
@subject = "[YOURSITE] "
@sent_on = Time.now
@body[:<%= file_name %>] = <%= file_name %>
    end
end