public
Description: PLEASE CHECK http://github.com/lifo/docrails/wikis
Homepage: http://weblog.rubyonrails.org/2008/5/2/help-improve-rails-documentation-on-git-branch
Clone URL: git://github.com/lifo/docrails.git
Improve and cleanup ActionMailer documentation
Cody Fauser (author)
Wed May 14 06:10:02 -0700 2008
commit  b8c46c86f0b785f6afc3c58eeb1b347543f5901e
tree    15edaea17ba64e6c43abacee0d5a0af17604e293
parent  f4aaa2e99c350466e54afefdf278b4ba04008cd9
...
19
20
21
22
23
 
24
25
26
...
91
92
93
94
95
96
97
98
99
100
 
 
 
 
 
 
 
101
102
103
...
19
20
21
 
 
22
23
24
25
...
90
91
92
 
 
 
 
 
 
 
93
94
95
96
97
98
99
100
101
102
0
@@ -19,8 +19,7 @@ are all set up this way. An example of such a method:
0
     recipients recipient
0
     subject "[Signed up] Welcome #{recipient}"
0
     from "system@loudthinking.com"
0
-
0
- body(:recipient => recipient)
0
+ body :recipient => recipient
0
   end
0
 
0
 The body of the email is created by using an Action View template (regular
0
@@ -91,13 +90,13 @@ a limited number of email.
0
 
0
 The Base class has the full list of configuration options. Here's an example:
0
 
0
-ActionMailer::Base.smtp_settings = {
0
- :address=>'smtp.yourserver.com', # default: localhost
0
- :port=>'25', # default: 25
0
- :user_name=>'user',
0
- :password=>'pass',
0
- :authentication=>:plain # :plain, :login or :cram_md5
0
-}
0
+ ActionMailer::Base.smtp_settings = {
0
+ :address => 'smtp.yourserver.com', # default: localhost
0
+ :port => '25', # default: 25
0
+ :user_name => 'user',
0
+ :password => 'pass',
0
+ :authentication => :plain # :plain, :login or :cram_md5
0
+ }
0
 
0
 == Dependencies
0
 
...
35
36
37
38
 
39
40
41
...
127
128
129
130
131
132
133
134
 
 
 
 
 
135
136
137
...
145
146
147
 
148
149
150
...
167
168
169
170
171
 
 
 
 
172
 
 
 
173
174
175
...
210
211
212
213
 
214
215
216
217
 
 
 
218
219
220
...
227
228
229
230
 
231
232
233
234
 
 
 
235
236
237
 
238
239
 
240
241
242
...
35
36
37
 
38
39
40
41
...
127
128
129
 
 
 
 
 
130
131
132
133
134
135
136
137
...
145
146
147
148
149
150
151
...
168
169
170
 
 
171
172
173
174
175
176
177
178
179
180
181
...
216
217
218
 
219
220
 
 
 
221
222
223
224
225
226
...
233
234
235
 
236
237
 
 
 
238
239
240
241
242
 
243
244
 
245
246
247
248
0
@@ -35,7 +35,7 @@ module ActionMailer #:nodoc:
0
   # * <tt>subject</tt> - The subject of your email. Sets the <tt>Subject:</tt> header.
0
   # * <tt>from</tt> - Who the email you are sending is from. Sets the <tt>From:</tt> header.
0
   # * <tt>cc</tt> - Takes one or more email addresses. These addresses will receive a carbon copy of your email. Sets the <tt>Cc:</tt> header.
0
- # * <tt>bcc</tt> - Takes one or more email address. These addresses will receive a blind carbon copy of your email. Sets the <tt>Bcc</tt> header.
0
+ # * <tt>bcc</tt> - Takes one or more email address. These addresses will receive a blind carbon copy of your email. Sets the <tt>Bcc:</tt> header.
0
   # * <tt>sent_on</tt> - The date on which the message was sent. If not set, the header wil be set by the delivery agent.
0
   # * <tt>content_type</tt> - Specify the content type of the message. Defaults to <tt>text/plain</tt>.
0
   # * <tt>headers</tt> - Specify additional headers to be set for the message, e.g. <tt>headers 'X-Mail-Count' => 107370</tt>.
0
@@ -127,11 +127,11 @@ module ActionMailer #:nodoc:
0
   #
0
   # class MyMailer < ActionMailer::Base
0
   # def signup_notification(recipient)
0
- # recipients recipient.email_address_with_name
0
- # subject "New account information"
0
- # body "account" => recipient
0
- # from "system@example.com"
0
- # content_type "text/html" # Here's where the magic happens
0
+ # recipients recipient.email_address_with_name
0
+ # subject "New account information"
0
+ # from "system@example.com"
0
+ # body :account => recipient
0
+ # content_type "text/html"
0
   # end
0
   # end
0
   #
0
@@ -145,6 +145,7 @@ module ActionMailer #:nodoc:
0
   # recipients recipient.email_address_with_name
0
   # subject "New account information"
0
   # from "system@example.com"
0
+ # content_type "multipart/alternative"
0
   #
0
   # part :content_type => "text/html",
0
   # :body => render_message("signup-as-html", :account => recipient)
0
@@ -167,9 +168,14 @@ module ActionMailer #:nodoc:
0
   # * signup_notification.text.x-yaml.erb
0
   #
0
   # Each would be rendered and added as a separate part to the message,
0
- # with the corresponding content type. The same body hash is passed to
0
- # each template.
0
+ # with the corresponding content type. The content type for the entire
0
+ # message is automatically set to <tt>multipart/alternative</tt>, which indicates
0
+ # that the email contains multiple different representations of the same email
0
+ # body. The same body hash is passed to each template.
0
   #
0
+ # Implicit template rendering is not performed if any attachments or parts have been added to the email.
0
+ # This means that you'll have to manually add each part to the email and set the content type of the email
0
+ # to <tt>multipart/alternative</tt>.
0
   #
0
   # = Attachments
0
   #
0
@@ -210,11 +216,11 @@ module ActionMailer #:nodoc:
0
   # * <tt>:user_name</tt> - If your mail server requires authentication, set the username in this setting.
0
   # * <tt>:password</tt> - If your mail server requires authentication, set the password in this setting.
0
   # * <tt>:authentication</tt> - If your mail server requires authentication, you need to specify the authentication type here.
0
- # This is a symbol and one of <tt>:plain</tt>, <tt>:login</tt>, <tt>:cram_md5</tt>
0
+ # This is a symbol and one of <tt>:plain</tt>, <tt>:login</tt>, <tt>:cram_md5</tt>.
0
   #
0
- # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method
0
- # * <tt>:location</tt> - The location of the sendmail executable, defaults to "/usr/sbin/sendmail"
0
- # * <tt>:arguments</tt> - The command line arguments
0
+ # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
0
+ # * <tt>:location</tt> - The location of the sendmail executable. Defaults to <tt>/usr/sbin/sendmail</tt>.
0
+ # * <tt>:arguments</tt> - The command line arguments. Defaults to <tt>-i -t</tt>.
0
   #
0
   # * <tt>raise_delivery_errors</tt> - Whether or not errors should be raised if the email fails to be delivered.
0
   #
0
@@ -227,16 +233,16 @@ module ActionMailer #:nodoc:
0
   # for unit and functional testing.
0
   #
0
   # * <tt>default_charset</tt> - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also
0
- # pick a different charset from inside a method with <tt>@charset</tt>.
0
+ # pick a different charset from inside a method with +charset+.
0
   # * <tt>default_content_type</tt> - The default content type used for the main part of the message. Defaults to "text/plain". You
0
- # can also pick a different content type from inside a method with <tt>@content_type</tt>.
0
- # * <tt>default_mime_version</tt> - The default mime version used for the message. Defaults to "1.0". You
0
- # can also pick a different value from inside a method with <tt>@mime_version</tt>.
0
+ # can also pick a different content type from inside a method with +content_type+.
0
+ # * <tt>default_mime_version</tt> - The default mime version used for the message. Defaults to <tt>1.0</tt>. You
0
+ # can also pick a different value from inside a method with +mime_version+.
0
   # * <tt>default_implicit_parts_order</tt> - When a message is built implicitly (i.e. multiple parts are assembled from templates
0
   # which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to
0
- # ["text/html", "text/enriched", "text/plain"]. Items that appear first in the array have higher priority in the mail client
0
+ # <tt>["text/html", "text/enriched", "text/plain"]</tt>. Items that appear first in the array have higher priority in the mail client
0
   # and appear last in the mime encoded message. You can also pick a different order from inside a method with
0
- # <tt>@implicit_parts_order</tt>.
0
+ # +implicit_parts_order+.
0
   class Base
0
     include AdvAttrAccessor, PartContainer
0
     include ActionController::UrlWriter if Object.const_defined?(:ActionController)

Comments

    No one has commented yet.