diff options
Diffstat (limited to 'railties/lib/generators/rails/mailer/templates/mailer.rb')
-rw-r--r-- | railties/lib/generators/rails/mailer/templates/mailer.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/railties/lib/generators/rails/mailer/templates/mailer.rb b/railties/lib/generators/rails/mailer/templates/mailer.rb index 90e0b712d6..7343eb28b3 100644 --- a/railties/lib/generators/rails/mailer/templates/mailer.rb +++ b/railties/lib/generators/rails/mailer/templates/mailer.rb @@ -1,14 +1,16 @@ class <%= class_name %> < ActionMailer::Base + default :from => "from@example.com" <% for action in actions -%> - def <%= action %>(sent_at = Time.now) - subject '<%= class_name %>#<%= action %>' - recipients '' - from '' - sent_on sent_at - - body :greeting => 'Hi,' - end + # 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 => "to@example.org" + end <% end -%> end |