Skip to content
This repository
Browse code

Updated docs and otherwise

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 20bd4bd3e2bff716acdf48bba1b97a1afdcd088d 1 parent bf2bddd
David Heinemeier Hansson authored September 02, 2006
2  actionmailer/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* Fixed that iconv decoding should catch InvalidEncoding #3153 [jon@siliconcircus.com]
  4
+
3 5
 * Tighten rescue clauses.  #5985 [james@grayproductions.net]
4 6
 
5 7
 * Automatically included ActionController::UrlWriter, such that URL generation can happen within ActionMailer controllers. [DHH]
2  actionmailer/MIT-LICENSE
... ...
@@ -1,4 +1,4 @@
1  
-Copyright (c) 2004 David Heinemeier Hansson
  1
+Copyright (c) 2004-2006 David Heinemeier Hansson
2 2
 
3 3
 Permission is hereby granted, free of charge, to any person obtaining
4 4
 a copy of this software and associated documentation files (the
2  actionmailer/README
... ...
@@ -1,7 +1,7 @@
1 1
 = Action Mailer -- Easy email delivery and testing
2 2
 
3 3
 Action Mailer is a framework for designing email-service layers. These layers
4  
-are used to consolidate code for sending out forgotten passwords, welcoming
  4
+are used to consolidate code for sending out forgotten passwords, welcome
5 5
 wishes on signup, invoices for billing, and any other use case that requires
6 6
 a written notification to either a person or another system.
7 7
 
2  actionmailer/Rakefile
@@ -54,7 +54,7 @@ spec = Gem::Specification.new do |s|
54 54
   s.rubyforge_project = "actionmailer"
55 55
   s.homepage = "http://www.rubyonrails.org"
56 56
 
57  
-  s.add_dependency('actionpack', '= 1.12.1' + PKG_BUILD)
  57
+  s.add_dependency('actionpack', '= 1.12.5' + PKG_BUILD)
58 58
 
59 59
   s.has_rdoc = true
60 60
   s.requirements << 'none'
2  actionmailer/lib/action_mailer.rb
@@ -27,7 +27,7 @@
27 27
     require 'action_controller'
28 28
   rescue LoadError
29 29
     require 'rubygems'
30  
-    require_gem 'actionpack', '>= 1.9.1'
  30
+    require_gem 'actionpack', '>= 1.12.5'
31 31
   end
32 32
 end
33 33
 
44  actionmailer/lib/action_mailer/base.rb
@@ -7,7 +7,9 @@
7 7
 module ActionMailer #:nodoc:
8 8
   # ActionMailer allows you to send email from your application using a mailer model and views.
9 9
   #
  10
+  #
10 11
   # = Mailer Models
  12
+  #
11 13
   # To use ActionMailer, you need to create a mailer model.
12 14
   #   
13 15
   #   $ script/generate mailer Notifier
@@ -23,7 +25,7 @@ module ActionMailer #:nodoc:
23 25
   #      recipients recipient.email_address_with_name
24 26
   #      from       "system@example.com"
25 27
   #      subject    "New account information"
26  
-  #      body       "account" => recipient
  28
+  #      body       :account => recipient
27 29
   #    end
28 30
   #  end
29 31
   #
@@ -45,7 +47,9 @@ module ActionMailer #:nodoc:
45 47
   # in an instance variable <tt>@account</tt> with the value of <tt>recipient</tt> being accessible in the 
46 48
   # view.
47 49
   #
48  
-  # = Mailer Views
  50
+  #
  51
+  # = Mailer views
  52
+  #
49 53
   # Like ActionController, each mailer class has a corresponding view directory
50 54
   # in which each method of the class looks for a template with its name.
51 55
   # To define a template to be used with a mailing, create an <tt>.rhtml</tt> file with the same name as the method
@@ -59,7 +63,30 @@ module ActionMailer #:nodoc:
59 63
   #   Hi <%= @account.name %>,
60 64
   #   Thanks for joining our service! Please check back often.
61 65
   #
62  
-  # = Sending Mail
  66
+  # You can even use Action Pack helpers in these views. For example:
  67
+  #
  68
+  #   You got a new note!
  69
+  #   <%= truncate(note.body, 25) %>
  70
+  # 
  71
+  #
  72
+  # = Generating URLs for mailer views
  73
+  #
  74
+  # If your view includes URLs from the application, you need to use url_for in the mailing method instead of the view.
  75
+  # Unlike controllers from Action Pack, the mailer instance doesn't have any context about the incoming request. That's
  76
+  # why you need to jump this little hoop and supply all the details needed for the URL. Example:
  77
+  #
  78
+  #    def signup_notification(recipient)
  79
+  #      recipients recipient.email_address_with_name
  80
+  #      from       "system@example.com"
  81
+  #      subject    "New account information"
  82
+  #      body       :account => recipient,
  83
+  #                 :home_page => url_for(:host => "example.com", :controller => "welcome", :action => "greeting")
  84
+  #    end
  85
+  #
  86
+  # You can now access @home_page in the template and get http://example.com/welcome/greeting.
  87
+  #
  88
+  # = Sending mail
  89
+  #
63 90
   # Once a mailer action and template are defined, you can deliver your message or create it and save it 
64 91
   # for delivery later:
65 92
   #
@@ -73,7 +100,9 @@ module ActionMailer #:nodoc:
73 100
   # like to deliver. The <tt>signup_notification</tt> method defined above is
74 101
   # delivered by invoking <tt>Notifier.deliver_signup_notification</tt>.
75 102
   #
76  
-  # = HTML Email
  103
+  #
  104
+  # = HTML email
  105
+  #
77 106
   # To send mail as HTML, make sure your view (the <tt>.rhtml</tt> file) generates HTML and
78 107
   # set the content type to html.
79 108
   #
@@ -87,7 +116,9 @@ module ActionMailer #:nodoc:
87 116
   #     end
88 117
   #   end  
89 118
   #
90  
-  # = Multipart Email
  119
+  #
  120
+  # = Multipart email
  121
+  #
91 122
   # You can explicitly specify multipart messages:
92 123
   #
93 124
   #   class ApplicationMailer < ActionMailer::Base
@@ -120,7 +151,9 @@ module ActionMailer #:nodoc:
120 151
   # with the corresponding content type. The same body hash is passed to
121 152
   # each template.
122 153
   #
  154
+  #
123 155
   # = Attachments
  156
+  #
124 157
   # Attachments can be added by using the +attachment+ method.
125 158
   #
126 159
   # Example:
@@ -141,6 +174,7 @@ module ActionMailer #:nodoc:
141 174
   #     end
142 175
   #   end 
143 176
   #
  177
+  #
144 178
   # = Configuration options
145 179
   #
146 180
   # These options are specified on the class level, like <tt>ActionMailer::Base.template_root = "/my/templates"</tt>
2  actionmailer/lib/action_mailer/version.rb
@@ -2,7 +2,7 @@ module ActionMailer
2 2
   module VERSION #:nodoc:
3 3
     MAJOR = 1
4 4
     MINOR = 2
5  
-    TINY  = 1
  5
+    TINY  = 5
6 6
 
7 7
     STRING = [MAJOR, MINOR, TINY].join('.')
8 8
   end

0 notes on commit 20bd4bd

Please sign in to comment.
Something went wrong with that request. Please try again.