aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails/mailer
diff options
context:
space:
mode:
authorJosé Valim and Mikel Lindsaar <pair@programming.com>2010-01-25 13:13:29 +0100
committerJosé Valim and Mikel Lindsaar <pair@programming.com>2010-01-25 13:20:32 +0100
commit9cb3ca1d29eb770c1a7adac3798666847fceee2b (patch)
tree70aeb2f12e00d98c13d7f55bdd9d445d4223fcfd /railties/lib/generators/rails/mailer
parentad8f5d4106c77ed1d054bf3b29bec94df557a7cd (diff)
downloadrails-9cb3ca1d29eb770c1a7adac3798666847fceee2b.tar.gz
rails-9cb3ca1d29eb770c1a7adac3798666847fceee2b.tar.bz2
rails-9cb3ca1d29eb770c1a7adac3798666847fceee2b.zip
Change mailer generator templates and refactor the whole naming schema.
Diffstat (limited to 'railties/lib/generators/rails/mailer')
-rw-r--r--railties/lib/generators/rails/mailer/templates/mailer.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/railties/lib/generators/rails/mailer/templates/mailer.rb b/railties/lib/generators/rails/mailer/templates/mailer.rb
index 90e0b712d6..5e7ef42370 100644
--- a/railties/lib/generators/rails/mailer/templates/mailer.rb
+++ b/railties/lib/generators/rails/mailer/templates/mailer.rb
@@ -1,14 +1,15 @@
class <%= class_name %> < ActionMailer::Base
+ delivers_from "mail@<%= application_name %>.com"
<% for action in actions -%>
- def <%= action %>(sent_at = Time.now)
- subject '<%= class_name %>#<%= action %>'
- recipients ''
- from ''
- sent_on sent_at
-
- body :greeting => 'Hi,'
+ # Subject can be set in your I18n file at config/locales/en.yml
+ # with the following lookup:
+ #
+ # en.actionmailer.<%= file_name %>.<%= action %>.subject
+ #
+ def <%= action %>
+ @greeting = "Hi"
+ mail(:to => "")
end
-
<% end -%>
-end
+end \ No newline at end of file