actionmailer 3.1.12 → 3.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionmailer might be problematic. Click here for more details.

@@ -1,37 +1,449 @@
1
- ## Rails 3.1.11 (Feb 11, 2011) ##
1
+ ## Rails 3.1.0 (August 30, 2011) ##
2
2
 
3
- * No changes.
3
+ * No changes
4
4
 
5
- ## Rails 3.1.10 (Jan 8, 2013) ##
6
5
 
7
- * No changes.
6
+ ## Rails 3.0.7 (April 18, 2011) ##
8
7
 
9
- ## Rails 3.1.9 (Jan 2, 2013) ##
8
+ * remove AM delegating register_observer and register_interceptor to Mail *Josh Kalderimis*
10
9
 
11
- * No changes.
12
10
 
13
- ## Rails 3.1.8 (Aug 9, 2012) ##
11
+ * Rails 3.0.6 (April 5, 2011)
12
+
13
+ * Don't allow i18n to change the minor version, version now set to ~> 0.5.0 *Santiago Pastorino*
14
14
 
15
- * No changes.
16
15
 
17
- ## Rails 3.1.7 (Jul 26, 2012) ##
16
+ ## Rails 3.0.5 (February 26, 2011) ##
18
17
 
19
18
  * No changes.
20
19
 
21
- ## Rails 3.1.6 (Jun 12, 2012) ##
20
+
21
+ ## Rails 3.0.4 (February 8, 2011) ##
22
22
 
23
23
  * No changes.
24
24
 
25
- ## Rails 3.1.5 (May 31, 2012) ##
26
25
 
27
- * Increase minimum version of mail.
26
+ ## Rails 3.0.3 (November 16, 2010) ##
28
27
 
29
- ## Rails 3.1.1 (October 7, 2011) ##
28
+ * No changes.
30
29
 
31
- * No changes
32
30
 
33
- ## Rails 3.1.0 (August 30, 2011) ##
31
+ ## Rails 3.0.2 (November 15, 2010) ##
34
32
 
35
33
  * No changes
36
34
 
37
- Please check [3-0-stable](https://github.com/rails/rails/blob/3-0-stable/actionmailer/CHANGELOG) for previous changes.
35
+
36
+ ## Rails 3.0.1 (October 15, 2010) ##
37
+
38
+ * No Changes, just a version bump.
39
+
40
+
41
+ ## Rails 3.0.0 (August 29, 2010) ##
42
+
43
+ * subject is automatically looked up on I18n using mailer_name and action_name as scope as in t(".subject") *JK*
44
+
45
+ * Changed encoding behaviour of mail, so updated tests in actionmailer and bumped mail version to 2.2.1 *ML*
46
+
47
+ * Added ability to pass Proc objects to the defaults hash *ML*
48
+
49
+ * Removed all quoting.rb type files from ActionMailer and put Mail 2.2.0 in instead *ML*
50
+
51
+ * Lot of updates to various test cases that now work better with the new Mail and so have different expectations
52
+
53
+ * Added interceptors and observers from Mail *ML*
54
+
55
+ ActionMailer::Base.register_interceptor calls Mail.register_interceptor
56
+ ActionMailer::Base.register_observer calls Mail.register_observer
57
+
58
+ * Mail::Part now no longer has nil as a default charset, it is always set to something, and defaults to UTF-8
59
+
60
+ * Added explict setting of charset in set_fields! method to make sure Mail has the user defined default
61
+
62
+ * Removed quoting.rb and refactored for Mail to take responsibility of all quoting and auto encoding requirements for the header.
63
+
64
+ * Fixed several tests which had incorrect encoding.
65
+
66
+ * Changed all utf-8 to UTF-8 for consistency
67
+
68
+ * Whole new API added with tests. See base.rb for full details. Old API is deprecated.
69
+
70
+ * The Mail::Message class has helped methods for all the field types that return 'common' defaults for the common use case, so to get the subject, mail.subject will give you a string, mail.date will give you a DateTime object, mail.from will give you an array of address specs (mikel@test.lindsaar.net) etc. If you want to access the field object itself, call mail[:field_name] which will return the field object you want, which you can then chain, like mail[:from].formatted
71
+
72
+ * Mail#content_type now returns the content_type field as a string. If you want the mime type of a mail, then you call Mail#mime_type (eg, text/plain), if you want the parameters of the content type field, you call Mail#content_type_parameters which gives you a hash, eg {'format' => 'flowed', 'charset' => 'utf-8'}
73
+
74
+ * ActionMailer::Base :default_implicit_parts_order now is in the sequence of the order you want, no reversing of ordering takes place. The default order now is text/plain, then text/enriched, then text/html and then any other part that is not one of these three.
75
+
76
+ * Mail does not have "quoted_body", "quoted_subject" etc. All of these are accessed via body.encoded, subject.encoded etc
77
+
78
+ * Every object in a Mail object returns an object, never a string. So Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want.
79
+ * Mail::Message#set_content_type does not exist, it is simply Mail::Message#content_type
80
+
81
+ * Every mail message gets a unique message_id unless you specify one, had to change all the tests that check for equality with expected.encoded == actual.encoded to first replace their message_ids with control values
82
+
83
+ * Mail now has a proper concept of parts, remove the ActionMailer::Part and ActionMailer::PartContainer classes
84
+
85
+ * Calling #encoded on any object returns it as a string ready to go into the output stream of an email, this means it includes the \r\n at the end of the lines and the object is pre-wrapped with \r\n\t if it is a header field. Also, the "encoded" value includes the field name if it is a header field.
86
+
87
+ * Attachments are only the actual attachment, with filename etc. A part contains an attachment. The part has the content_type etc. So attachments.last.content_type is invalid. But parts.last.content_type
88
+
89
+ * There is no idea of a "sub_head" in Mail. A part is just a Message with some extra functionality, so it just has a "header" like a normal mail message
90
+
91
+
92
+ ## 2.3.2 Final (March 15, 2009) ##
93
+
94
+ * Fixed that ActionMailer should send correctly formatted Return-Path in MAIL FROM for SMTP #1842 *Matt Jones*
95
+
96
+ * Fixed RFC-2045 quoted-printable bug #1421 *squadette*
97
+
98
+ * Fixed that no body charset would be set when there are attachments present #740 *Paweł Kondzior*
99
+
100
+
101
+ ## 2.2.1 RC2 (November 14th, 2008) ##
102
+
103
+ * Turn on STARTTLS if it is available in Net::SMTP (added in Ruby 1.8.7) and the SMTP server supports it (This is required for Gmail's SMTP server) #1336 *Grant Hollingworth*
104
+
105
+
106
+ ## 2.2.0 RC1 (October 24th, 2008) ##
107
+
108
+ * Add layout functionality to mailers *Pratik Naik*
109
+
110
+ Mailer layouts behaves just like controller layouts, except layout names need to
111
+ have '_mailer' postfix for them to be automatically picked up.
112
+
113
+
114
+ ## 2.1.0 (May 31st, 2008) ##
115
+
116
+ * Fixed that a return-path header would be ignored #7572 *joost*
117
+
118
+ * Less verbose mail logging: just recipients for :info log level; the whole email for :debug only. #8000 *iaddict, Tarmo Tänav*
119
+
120
+ * Updated TMail to version 1.2.1 *Mikel Lindsaar*
121
+
122
+ * Fixed that you don't have to call super in ActionMailer::TestCase#setup #10406 *jamesgolick*
123
+
124
+
125
+ ## 2.0.2 (December 16th, 2007) ##
126
+
127
+ * Included in Rails 2.0.2
128
+
129
+
130
+ ## 2.0.1 (December 7th, 2007) ##
131
+
132
+ * Update ActionMailer so it treats ActionView the same way that ActionController does. Closes #10244 *Rick Olson*
133
+
134
+ * Pass the template_root as an array as ActionView's view_path
135
+ * Request templates with the "#{mailer_name}/#{action}" as opposed to just "#{action}"
136
+
137
+ * Fixed that partials would be broken when using text.plain.erb as the extension #10130 *java*
138
+
139
+ * Update README to use new smtp settings configuration API. Closes #10060 *psq*
140
+
141
+ * Allow ActionMailer subclasses to individually set their delivery method (so two subclasses can have different delivery methods) #10033 *Zach Dennis*
142
+
143
+ * Update TMail to v1.1.0. Use an updated version of TMail if available. *Mikel Lindsaar*
144
+
145
+ * Introduce a new base test class for testing Mailers. ActionMailer::TestCase *Michael Koziarski*
146
+
147
+ * Fix silent failure of rxml templates. #9879 *jstewart*
148
+
149
+ * Fix attachment decoding when using the TMail C extension. #7861 *orangechicken*
150
+
151
+ * Increase mail delivery test coverage. #8692 *Kamal Fariz Mahyuddin*
152
+
153
+ * Register alternative template engines using ActionMailer::Base.register_template_extension('haml'). #7534 *cwd, Josh Peek*
154
+
155
+ * Only load ActionController::UrlWriter if ActionController is present *Rick Olson*
156
+
157
+ * Make sure parsed emails recognized attachments nested inside multipart parts. #6714 *Jamis Buck*
158
+
159
+ * Allow mailer actions named send by using __send__ internally. #6467 *iGEL*
160
+
161
+ * Add assert_emails and assert_no_emails to test the number of emails delivered. #6479 *Jonathan Viney*
162
+ # Assert total number of emails delivered:
163
+ assert_emails 0
164
+ ContactMailer.deliver_contact
165
+ assert_emails 1
166
+
167
+ # Assert number of emails delivered within a block:
168
+ assert_emails 1 do
169
+ post :signup, :name => 'Jonathan'
170
+ end
171
+
172
+
173
+ ## 1.3.3 (March 12th, 2007) ##
174
+
175
+ * Depend on Action Pack 1.13.3
176
+
177
+
178
+ ## 1.3.2 (February 5th, 2007) ##
179
+
180
+ * Deprecate server_settings renaming it to smtp_settings, add sendmail_settings to allow you to override the arguments to and location of the sendmail executable. *Michael Koziarski*
181
+
182
+
183
+ ## 1.3.1 (January 16th, 2007) ##
184
+
185
+ * Depend on Action Pack 1.13.1
186
+
187
+
188
+ ## 1.3.0 (January 16th, 2007) ##
189
+
190
+ * Make mime version default to 1.0. closes #2323 *ror@andreas-s.net*
191
+
192
+ * Make sure quoted-printable text is decoded correctly when only portions of the text are encoded. closes #3154. *jon@siliconcircus.com*
193
+
194
+ * Make sure DOS newlines in quoted-printable text are normalized to unix newlines before unquoting. closes #4166 and #4452. *Jamis Buck*
195
+
196
+ * Fixed that iconv decoding should catch InvalidEncoding #3153 *jon@siliconcircus.com*
197
+
198
+ * Tighten rescue clauses. #5985 *james@grayproductions.net*
199
+
200
+ * Automatically included ActionController::UrlWriter, such that URL generation can happen within ActionMailer controllers. *David Heinemeier Hansson*
201
+
202
+ * Replace Reloadable with Reloadable::Deprecated. *Nicholas Seckar*
203
+
204
+ * Mailer template root applies to a class and its subclasses rather than acting globally. #5555 *somekool@gmail.com*
205
+
206
+ * Resolve action naming collision. #5520 *ssinghi@kreeti.com*
207
+
208
+ * ActionMailer::Base documentation rewrite. Closes #4991 *Kevin Clark, Marcel Molina Jr.*
209
+
210
+ * Replace alias method chaining with Module#alias_method_chain. *Marcel Molina Jr.*
211
+
212
+ * Replace Ruby's deprecated append_features in favor of included. *Marcel Molina Jr.*
213
+
214
+ * Correct spurious documentation example code which results in a SyntaxError. *Marcel Molina Jr.*
215
+
216
+
217
+ ## 1.2.1 (April 6th, 2006) ##
218
+
219
+ * Be part of Rails 1.1.1
220
+
221
+
222
+ ## 1.2.0 (March 27th, 2006) ##
223
+
224
+ * Nil charset caused subject line to be improperly quoted in implicitly multipart messages #2662 *ehalvorsen+rails@runbox.com*
225
+
226
+ * Parse content-type apart before using it so that sub-parts of the header can be set correctly #2918 *Jamis Buck*
227
+
228
+ * Make custom headers work in subparts #4034 *elan@bluemandrill.com*
229
+
230
+ * Template paths with dot chars in them no longer mess up implicit template selection for multipart messages #3332 *Chad Fowler*
231
+
232
+ * Make sure anything with content-disposition of "attachment" is passed to the attachment presenter when parsing an email body *Jamis Buck*
233
+
234
+ * Make sure TMail#attachments includes anything with content-disposition of "attachment", regardless of content-type *Jamis Buck*
235
+
236
+
237
+ ## 1.1.5 (December 13th, 2005) ##
238
+
239
+ * Become part of Rails 1.0
240
+
241
+
242
+ ## 1.1.4 (December 7th, 2005) ##
243
+
244
+ * Rename Version constant to VERSION. #2802 *Marcel Molina Jr.*
245
+
246
+ * Stricter matching for implicitly multipart filenames excludes files ending in unsupported extensions (such as foo.rhtml.bak) and without a two-part content type (such as foo.text.rhtml or foo.text.really.plain.rhtml). #2398 *Dave Burt <dave@burt.id.au>, Jeremy Kemper*
247
+
248
+
249
+ ## 1.1.3 (November 7th, 2005) ##
250
+
251
+ * Allow Mailers to have custom initialize methods that set default instance variables for all mail actions #2563 *mrj@bigpond.net.au*
252
+
253
+
254
+ ## 1.1.2 (October 26th, 2005) ##
255
+
256
+ * Upgraded to Action Pack 1.10.2
257
+
258
+
259
+ ## 1.1.1 (October 19th, 2005) ##
260
+
261
+ * Upgraded to Action Pack 1.10.1
262
+
263
+
264
+ ## 1.1.0 (October 16th, 2005) ##
265
+
266
+ * Update and extend documentation (rdoc)
267
+
268
+ * Minero Aoki made TMail available to Rails/ActionMailer under the MIT license (instead of LGPL) *RubyConf '05*
269
+
270
+ * Austin Ziegler made Text::Simple available to Rails/ActionMailer under a MIT-like licens *See rails ML, subject "Text::Format Licence Exception" on Oct 15, 2005*
271
+
272
+ * Fix vendor require paths to prevent files being required twice
273
+
274
+ * Don't add charset to content-type header for a part that contains subparts (for AOL compatibility) #2013 *John Long*
275
+
276
+ * Preserve underscores when unquoting message bodies #1930
277
+
278
+ * Encode multibyte characters correctly #1894
279
+
280
+ * Multipart messages specify a MIME-Version header automatically #2003 *John Long*
281
+
282
+ * Add a unified render method to ActionMailer (delegates to ActionView::Base#render)
283
+
284
+ * Move mailer initialization to a separate (overridable) method, so that subclasses may alter the various defaults #1727
285
+
286
+ * Look at content-location header (if available) to determine filename of attachments #1670
287
+
288
+ * ActionMailer::Base.deliver(email) had been accidentally removed, but was documented in the Rails book #1849
289
+
290
+ * Fix problem with sendmail delivery where headers should be delimited by \n characters instead of \r\n, which confuses some mail readers #1742 *Kent Sibilev*
291
+
292
+
293
+ ## 1.0.1 (11 July, 2005) ##
294
+
295
+ * Bind to Action Pack 1.9.1
296
+
297
+
298
+ ## 1.0.0 (6 July, 2005) ##
299
+
300
+ * Avoid adding nil header values #1392
301
+
302
+ * Better multipart support with implicit multipart/alternative and sorting of subparts *John Long*
303
+
304
+ * Allow for nested parts in multipart mails #1570 *Flurin Egger*
305
+
306
+ * Normalize line endings in outgoing mail bodies to "\n" #1536 *John Long*
307
+
308
+ * Allow template to be explicitly specified #1448 *tuxie@dekadance.se*
309
+
310
+ * Allow specific "multipart/xxx" content-type to be set on multipart messages #1412 *Flurin Egger*
311
+
312
+ * Unquoted @ characters in headers are now accepted in spite of RFC 822 #1206
313
+
314
+ * Helper support (borrowed from ActionPack)
315
+
316
+ * Silently ignore Errno::EINVAL errors when converting text.
317
+
318
+ * Don't cause an error when parsing an encoded attachment name #1340 *lon@speedymac.com*
319
+
320
+ * Nested multipart message parts are correctly processed in TMail::Mail#body
321
+
322
+ * BCC headers are removed when sending via SMTP #1402
323
+
324
+ * Added 'content_type' accessor, to allow content type to be set on a per-message basis. content_type defaults to "text/plain".
325
+
326
+ * Silently ignore Iconv::IllegalSequence errors when converting text #1341 *lon@speedymac.com*
327
+
328
+ * Support attachments and multipart messages.
329
+
330
+ * Added new accessors for the various mail properties.
331
+
332
+ * Fix to only perform the charset conversion if a 'from' and a 'to' charset are given (make no assumptions about what the charset was) #1276 *Jamis Buck*
333
+
334
+ * Fix attachments and content-type problems #1276 *Jamis Buck*
335
+
336
+ * Fixed the TMail#body method to look at the content-transfer-encoding header and unquote the body according to the rules it specifies #1265 *Jamis Buck*
337
+
338
+ * Added unquoting even if the iconv lib can't be loaded--in that case, only the charset conversion is skipped #1265 *Jamis Buck*
339
+
340
+ * Added automatic decoding of base64 bodies #1214 *Jamis Buck*
341
+
342
+ * Added that delivery errors are caught in a way so the mail is still returned whether the delivery was successful or not
343
+
344
+ * Fixed that email address like "Jamis Buck, M.D." <wild.medicine@example.net> would cause the quoter to generate emails resulting in "bad address" errors from the mail server #1220 *Jamis Buck*
345
+
346
+
347
+ ## 0.9.1 (20th April, 2005) ##
348
+
349
+ * Depend on Action Pack 1.8.1
350
+
351
+
352
+ ## 0.9.0 (19th April, 2005) ##
353
+
354
+ * Added that deliver_* will now return the email that was sent
355
+
356
+ * Added that quoting to UTF-8 only happens if the characters used are in that range #955 *Jamis Buck*
357
+
358
+ * Fixed quoting for all address headers, not just to #955 *Jamis Buck*
359
+
360
+ * Fixed unquoting of emails that doesn't have an explicit charset #1036 *wolfgang@stufenlos.net*
361
+
362
+
363
+ ## 0.8.1 (27th March, 2005) ##
364
+
365
+ * Fixed that if charset was found that the end of a mime part declaration TMail would throw an error #919 *lon@speedymac.com*
366
+
367
+ * Fixed that TMail::Unquoter would fail to recognize quoting method if it was in lowercase #919 *lon@speedymac.com*
368
+
369
+ * Fixed that TMail::Encoder would fail when it attempts to parse e-mail addresses which are encoded using something other than the messages encoding method #919 *lon@speedymac.com*
370
+
371
+ * Added rescue for missing iconv library and throws warnings if subject/body is called on a TMail object without it instead
372
+
373
+
374
+ ## 0.8.0 (22th March, 2005) ##
375
+
376
+ * Added framework support for processing incoming emails with an Action Mailer class. See example in README.
377
+
378
+
379
+ ## 0.7.1 (7th March, 2005) ##
380
+
381
+ * Bind to newest Action Pack (1.5.1)
382
+
383
+
384
+ ## 0.7.0 (24th February, 2005) ##
385
+
386
+ * Added support for charsets for both subject and body. The default charset is now UTF-8 #673 [Jamis Buck]. Examples:
387
+
388
+ def iso_charset(recipient)
389
+ @recipients = recipient
390
+ @subject = "testing iso charsets"
391
+ @from = "system@loudthinking.com"
392
+ @body = "Nothing to see here."
393
+ @charset = "iso-8859-1"
394
+ end
395
+
396
+ def unencoded_subject(recipient)
397
+ @recipients = recipient
398
+ @subject = "testing unencoded subject"
399
+ @from = "system@loudthinking.com"
400
+ @body = "Nothing to see here."
401
+ @encode_subject = false
402
+ @charset = "iso-8859-1"
403
+ end
404
+
405
+
406
+ ## 0.6.1 (January 18th, 2005) ##
407
+
408
+ * Fixed sending of emails to use Tmail#from not the deprecated Tmail#from_address
409
+
410
+
411
+ ## 0.6 (January 17th, 2005) ##
412
+
413
+ * Fixed that bcc and cc should be settable through @bcc and @cc -- not just @headers["Bcc"] and @headers["Cc"] #453 *Eric Hodel*
414
+
415
+ * Fixed Action Mailer to be "warnings safe" so you can run with ruby -w and not get framework warnings #453 *Eric Hodel*
416
+
417
+
418
+ ## 0.5 ##
419
+
420
+ * Added access to custom headers, like cc, bcc, and reply-to #268 [Andreas Schwarz]. Example:
421
+
422
+ def post_notification(recipients, post)
423
+ @recipients = recipients
424
+ @from = post.author.email_address_with_name
425
+ @headers["bcc"] = SYSTEM_ADMINISTRATOR_EMAIL
426
+ @headers["reply-to"] = "notifications@example.com"
427
+ @subject = "[#{post.account.name} #{post.title}]"
428
+ @body["post"] = post
429
+ end
430
+
431
+ ## 0.4 (5) ##
432
+
433
+ * Consolidated the server configuration options into Base#server_settings= and expanded that with controls for authentication and more *Marten*
434
+ NOTE: This is an API change that could potentially break your application if you used the old application form. Please do change!
435
+
436
+ * Added Base#deliveries as an accessor for an array of emails sent out through that ActionMailer class when using the :test delivery option. *Jeremy Kemper*
437
+
438
+ * Added Base#perform_deliveries= which can be set to false to turn off the actual delivery of the email through smtp or sendmail.
439
+ This is especially useful for functional testing that shouldn't send off real emails, but still trigger delivery_* methods.
440
+
441
+ * Added option to specify delivery method with Base#delivery_method=. Default is :smtp and :sendmail is currently the only other option.
442
+ Sendmail is assumed to be present at "/usr/sbin/sendmail" if that option is used. *Kent Sibilev*
443
+
444
+ * Dropped "include TMail" as it added to much baggage into the default namespace (like Version) *Chad Fowler*
445
+
446
+
447
+ ## 0.3 ##
448
+
449
+ * First release
@@ -137,7 +137,7 @@ The Base class has the full list of configuration options. Here's an example:
137
137
 
138
138
  == Download and installation
139
139
 
140
- The latest version of Action Mailer can be installed with Rubygems:
140
+ The latest version of Action Mailer can be installed with RubyGems:
141
141
 
142
142
  % [sudo] gem install actionmailer
143
143
 
@@ -155,7 +155,7 @@ Action Mailer is released under the MIT license.
155
155
 
156
156
  API documentation is at
157
157
 
158
- * http://api.rubyonrails.com
158
+ * http://api.rubyonrails.org
159
159
 
160
160
  Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:
161
161
 
@@ -40,12 +40,10 @@ require 'active_support/lazy_load_hooks'
40
40
  module ActionMailer
41
41
  extend ::ActiveSupport::Autoload
42
42
 
43
- autoload :AdvAttrAccessor
44
43
  autoload :Collector
45
44
  autoload :Base
46
45
  autoload :DeliveryMethods
47
46
  autoload :MailHelper
48
- autoload :OldApi
49
47
  autoload :TestCase
50
48
  autoload :TestHelper
51
49
  end
@@ -1,5 +1,4 @@
1
1
  require 'mail'
2
- require 'action_mailer/tmail_compat'
3
2
  require 'action_mailer/collector'
4
3
  require 'active_support/core_ext/array/wrap'
5
4
  require 'active_support/core_ext/object/blank'
@@ -23,16 +22,16 @@ module ActionMailer #:nodoc:
23
22
  #
24
23
  # Examples:
25
24
  #
26
- # class Notifier < ActionMailer::Base
27
- # default :from => 'no-reply@example.com',
25
+ # class Notifier < ActionMailer::Base
26
+ # default :from => 'no-reply@example.com',
28
27
  # :return_path => 'system@example.com'
29
28
  #
30
- # def welcome(recipient)
31
- # @account = recipient
32
- # mail(:to => recipient.email_address_with_name,
33
- # :bcc => ["bcc@example.com", "Order Watcher <watcher@example.com>"])
34
- # end
35
- # end
29
+ # def welcome(recipient)
30
+ # @account = recipient
31
+ # mail(:to => recipient.email_address_with_name,
32
+ # :bcc => ["bcc@example.com", "Order Watcher <watcher@example.com>"])
33
+ # end
34
+ # end
36
35
  #
37
36
  # Within the mailer method, you have access to the following methods:
38
37
  #
@@ -132,13 +131,10 @@ module ActionMailer #:nodoc:
132
131
  #
133
132
  # config.action_mailer.default_url_options = { :host => "example.com" }
134
133
  #
135
- # Setting <tt>ActionMailer::Base.default_url_options</tt> directly is now deprecated, use the configuration
136
- # option mentioned above to set the default host.
137
- #
138
- # If you do decide to set a default <tt>:host</tt> for your mailers you want to use the
139
- # <tt>:only_path => false</tt> option when using <tt>url_for</tt>. This will ensure that absolute URLs are
140
- # generated because the <tt>url_for</tt> view helper will, by default, generate relative URLs when a
141
- # <tt>:host</tt> option isn't explicitly provided.
134
+ # When you decide to set a default <tt>:host</tt> for your mailers, then you need to make sure to use the
135
+ # <tt>:only_path => false</tt> option when using <tt>url_for</tt>. Since the <tt>url_for</tt> view helper
136
+ # will generate relative URLs by default when a <tt>:host</tt> option isn't explicitly provided, passing
137
+ # <tt>:only_path => false</tt> will ensure that absolute URLs are generated.
142
138
  #
143
139
  # = Sending mail
144
140
  #
@@ -217,15 +213,15 @@ module ActionMailer #:nodoc:
217
213
  #
218
214
  # = Observing and Intercepting Mails
219
215
  #
220
- # Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
221
- # register objects that are called during the mail delivery life cycle.
216
+ # Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
217
+ # register classes that are called during the mail delivery life cycle.
222
218
  #
223
- # An observer object must implement the <tt>:delivered_email(message)</tt> method which will be
219
+ # An observer class must implement the <tt>:delivered_email(message)</tt> method which will be
224
220
  # called once for every email sent after the email has been sent.
225
221
  #
226
- # An interceptor object must implement the <tt>:delivering_email(message)</tt> method which will be
222
+ # An interceptor class must implement the <tt>:delivering_email(message)</tt> method which will be
227
223
  # called before the email is sent, allowing you to make modifications to the email before it hits
228
- # the delivery agents. Your object should make any needed modifications directly to the passed
224
+ # the delivery agents. Your class should make any needed modifications directly to the passed
229
225
  # in Mail::Message instance.
230
226
  #
231
227
  # = Default Hash
@@ -298,9 +294,9 @@ module ActionMailer #:nodoc:
298
294
  # information and a cryptographic Message Digest 5 algorithm to hash important information)
299
295
  # * <tt>:enable_starttls_auto</tt> - When set to true, detects if STARTTLS is enabled in your SMTP server
300
296
  # and starts to use it.
301
- # * <tt>:openssl_verify_mode</tt> - When using TLS, you can set how OpenSSL checks the certificate. This is
302
- # really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name
303
- # of an OpenSSL verify constant ('none', 'peer', 'client_once','fail_if_no_peer_cert') or directly the
297
+ # * <tt>:openssl_verify_mode</tt> - When using TLS, you can set how OpenSSL checks the certificate. This is
298
+ # really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name
299
+ # of an OpenSSL verify constant ('none', 'peer', 'client_once','fail_if_no_peer_cert') or directly the
304
300
  # constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER,...).
305
301
  #
306
302
  # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
@@ -316,29 +312,16 @@ module ActionMailer #:nodoc:
316
312
  #
317
313
  # * <tt>delivery_method</tt> - Defines a delivery method. Possible values are <tt>:smtp</tt> (default),
318
314
  # <tt>:sendmail</tt>, <tt>:test</tt>, and <tt>:file</tt>. Or you may provide a custom delivery method
319
- # object eg. MyOwnDeliveryMethodClass.new. See the Mail gem documentation on the interface you need to
315
+ # object eg. MyOwnDeliveryMethodClass.new. See the Mail gem documentation on the interface you need to
320
316
  # implement for a custom delivery agent.
321
317
  #
322
318
  # * <tt>perform_deliveries</tt> - Determines whether emails are actually sent from Action Mailer when you
323
- # call <tt>.deliver</tt> on an mail message or on an Action Mailer method. This is on by default but can
319
+ # call <tt>.deliver</tt> on an mail message or on an Action Mailer method. This is on by default but can
324
320
  # be turned off to aid in functional testing.
325
321
  #
326
322
  # * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with
327
323
  # <tt>delivery_method :test</tt>. Most useful for unit and functional testing.
328
324
  #
329
- # * <tt>default_charset</tt> - This is now deprecated, use the +default+ method above to
330
- # set the default +:charset+.
331
- #
332
- # * <tt>default_content_type</tt> - This is now deprecated, use the +default+ method above
333
- # to set the default +:content_type+.
334
- #
335
- # * <tt>default_mime_version</tt> - This is now deprecated, use the +default+ method above
336
- # to set the default +:mime_version+.
337
- #
338
- # * <tt>default_implicit_parts_order</tt> - This is now deprecated, use the +default+ method above
339
- # to set the default +:parts_order+. Parts Order is used when a message is built implicitly
340
- # (i.e. multiple parts are assembled from templates which specify the content type in their
341
- # filenames) this variable controls how the parts are ordered.
342
325
  class Base < AbstractController::Base
343
326
  include DeliveryMethods
344
327
  abstract!
@@ -353,7 +336,6 @@ module ActionMailer #:nodoc:
353
336
  self.protected_instance_variables = %w(@_action_has_layout)
354
337
 
355
338
  helper ActionMailer::MailHelper
356
- include ActionMailer::OldApi
357
339
 
358
340
  private_class_method :new #:nodoc:
359
341
 
@@ -542,7 +524,7 @@ module ActionMailer #:nodoc:
542
524
  #
543
525
  # * <tt>:subject</tt> - The subject of the message, if this is omitted, Action Mailer will
544
526
  # ask the Rails I18n class for a translated <tt>:subject</tt> in the scope of
545
- # <tt>[:actionmailer, mailer_scope, action_name]</tt> or if this is missing, will translate the
527
+ # <tt>[mailer_scope, action_name]</tt> or if this is missing, will translate the
546
528
  # humanized version of the <tt>action_name</tt>
547
529
  # * <tt>:to</tt> - Who the message is destined for, can be a string of addresses, or an array
548
530
  # of addresses.
@@ -568,8 +550,8 @@ module ActionMailer #:nodoc:
568
550
  # method.
569
551
  #
570
552
  # When a <tt>:return_path</tt> is specified as header, that value will be used as the 'envelope from'
571
- # address for the Mail message. Setting this is useful when you want delivery notifications
572
- # sent to a different address than the one in <tt>:from</tt>. Mail will actually use the
553
+ # address for the Mail message. Setting this is useful when you want delivery notifications
554
+ # sent to a different address than the one in <tt>:from</tt>. Mail will actually use the
573
555
  # <tt>:return_path</tt> in preference to the <tt>:sender</tt> in preference to the <tt>:from</tt>
574
556
  # field for the 'envelope from' value.
575
557
  #
@@ -751,3 +733,4 @@ module ActionMailer #:nodoc:
751
733
  ActiveSupport.run_load_hooks(:action_mailer, self)
752
734
  end
753
735
  end
736
+
@@ -19,8 +19,9 @@ module ActionMailer
19
19
  options.stylesheets_dir ||= paths["public/stylesheets"].first
20
20
 
21
21
  # make sure readers methods get compiled
22
- options.asset_path ||= app.config.asset_path
23
- options.asset_host ||= app.config.asset_host
22
+ options.asset_path ||= app.config.asset_path
23
+ options.asset_host ||= app.config.asset_host
24
+ options.relative_url_root ||= app.config.relative_url_root
24
25
 
25
26
  ActiveSupport.on_load(:action_mailer) do
26
27
  include AbstractController::UrlFor
@@ -15,9 +15,22 @@ module ActionMailer
15
15
 
16
16
  include TestHelper
17
17
 
18
+ included do
19
+ class_attribute :_mailer_class
20
+ setup :initialize_test_deliveries
21
+ setup :set_expected_mail
22
+ end
23
+
18
24
  module ClassMethods
19
25
  def tests(mailer)
20
- self._mailer_class = mailer
26
+ case mailer
27
+ when String, Symbol
28
+ self._mailer_class = mailer.to_s.camelize.constantize
29
+ when Module
30
+ self._mailer_class = mailer
31
+ else
32
+ raise NonInferrableMailerError.new(mailer)
33
+ end
21
34
  end
22
35
 
23
36
  def mailer_class
@@ -35,8 +48,6 @@ module ActionMailer
35
48
  end
36
49
  end
37
50
 
38
- module InstanceMethods
39
-
40
51
  protected
41
52
 
42
53
  def initialize_test_deliveries
@@ -64,16 +75,8 @@ module ActionMailer
64
75
  def read_fixture(action)
65
76
  IO.readlines(File.join(Rails.root, 'test', 'fixtures', self.class.mailer_class.name.underscore, action))
66
77
  end
67
- end
68
-
69
- included do
70
- class_attribute :_mailer_class
71
- setup :initialize_test_deliveries
72
- setup :set_expected_mail
73
- end
74
78
  end
75
79
 
76
80
  include Behavior
77
-
78
81
  end
79
82
  end
@@ -1,9 +1,9 @@
1
1
  module ActionMailer
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
- MINOR = 1
5
- TINY = 12
6
- PRE = nil
4
+ MINOR = 2
5
+ TINY = 0
6
+ PRE = "rc1"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,43 +1,38 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.12
4
+ version: 3.2.0.rc1
5
+ prerelease: 6
5
6
  platform: ruby
6
7
  authors:
7
8
  - David Heinemeier Hansson
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-03-18 00:00:00.000000000 Z
12
+ date: 2011-12-20 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: actionpack
15
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &2156003760 !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '='
19
+ - - =
18
20
  - !ruby/object:Gem::Version
19
- version: 3.1.12
21
+ version: 3.2.0.rc1
20
22
  type: :runtime
21
23
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '='
25
- - !ruby/object:Gem::Version
26
- version: 3.1.12
24
+ version_requirements: *2156003760
27
25
  - !ruby/object:Gem::Dependency
28
26
  name: mail
29
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &2156002360 !ruby/object:Gem::Requirement
28
+ none: false
30
29
  requirements:
31
30
  - - ~>
32
31
  - !ruby/object:Gem::Version
33
- version: 2.4.4
32
+ version: 2.3.0
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- version: 2.4.4
35
+ version_requirements: *2156002360
41
36
  description: Email on Rails. Compose, deliver, receive, and test emails using the
42
37
  familiar controller/view pattern. First-class support for multipart email and attachments.
43
38
  email: david@loudthinking.com
@@ -48,17 +43,14 @@ files:
48
43
  - CHANGELOG.md
49
44
  - README.rdoc
50
45
  - MIT-LICENSE
51
- - lib/action_mailer/adv_attr_accessor.rb
52
46
  - lib/action_mailer/base.rb
53
47
  - lib/action_mailer/collector.rb
54
48
  - lib/action_mailer/delivery_methods.rb
55
49
  - lib/action_mailer/log_subscriber.rb
56
50
  - lib/action_mailer/mail_helper.rb
57
- - lib/action_mailer/old_api.rb
58
51
  - lib/action_mailer/railtie.rb
59
52
  - lib/action_mailer/test_case.rb
60
53
  - lib/action_mailer/test_helper.rb
61
- - lib/action_mailer/tmail_compat.rb
62
54
  - lib/action_mailer/version.rb
63
55
  - lib/action_mailer.rb
64
56
  - lib/rails/generators/mailer/mailer_generator.rb
@@ -66,26 +58,27 @@ files:
66
58
  - lib/rails/generators/mailer/USAGE
67
59
  homepage: http://www.rubyonrails.org
68
60
  licenses: []
69
- metadata: {}
70
61
  post_install_message:
71
62
  rdoc_options: []
72
63
  require_paths:
73
64
  - lib
74
65
  required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
75
67
  requirements:
76
- - - '>='
68
+ - - ! '>='
77
69
  - !ruby/object:Gem::Version
78
70
  version: 1.8.7
79
71
  required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
80
73
  requirements:
81
- - - '>='
74
+ - - ! '>'
82
75
  - !ruby/object:Gem::Version
83
- version: '0'
76
+ version: 1.3.1
84
77
  requirements:
85
78
  - none
86
79
  rubyforge_project:
87
- rubygems_version: 2.0.2
80
+ rubygems_version: 1.8.7
88
81
  signing_key:
89
- specification_version: 4
82
+ specification_version: 3
90
83
  summary: Email composition, delivery, and receiving framework (part of Rails).
91
84
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 1016c01acc5a1829182f3e3399935ca7f1005224
4
- data.tar.gz: 670a96ac98d3826b6576271dd96a0743c317820a
5
- SHA512:
6
- metadata.gz: db600d9f3b12d71c1a3368b36049c178427e59b91f065e86e62cc946f79a9731dfd052fb361957f7e2f3369ace9c8862a0688bc425a6eba87a818bcec2ccf201
7
- data.tar.gz: 48becd9ec352ad4517ba560da0a0d0a2ccc74a9e84ec88ed0e2dcc2211235829808341b92cad02122d09307a1eda41b40b420b2ba13ec86fc9130d1a798542e0
@@ -1,28 +0,0 @@
1
- module ActionMailer
2
- module AdvAttrAccessor #:nodoc:
3
- def adv_attr_accessor(name, deprecation=nil)
4
- ivar = "@#{name}"
5
- deprecation ||= "Please pass :#{name} as hash key to mail() instead"
6
-
7
- class_eval <<-ACCESSORS, __FILE__, __LINE__ + 1
8
- def #{name}=(value)
9
- ActiveSupport::Deprecation.warn "#{name}= is deprecated. #{deprecation}"
10
- #{ivar} = value
11
- end
12
-
13
- def #{name}(*args)
14
- raise ArgumentError, "expected 0 or 1 parameters" unless args.length <= 1
15
- if args.empty?
16
- ActiveSupport::Deprecation.warn "#{name}() is deprecated and will be removed in future versions."
17
- #{ivar} if instance_variable_names.include?(#{ivar.inspect})
18
- else
19
- ActiveSupport::Deprecation.warn "#{name}(value) is deprecated. #{deprecation}"
20
- #{ivar} = args.first
21
- end
22
- end
23
- ACCESSORS
24
-
25
- self.protected_instance_variables << ivar if self.respond_to?(:protected_instance_variables)
26
- end
27
- end
28
- end
@@ -1,255 +0,0 @@
1
- require 'active_support/concern'
2
- require 'active_support/core_ext/object/try'
3
- require 'active_support/core_ext/object/blank'
4
-
5
- module ActionMailer
6
- module OldApi #:nodoc:
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
- extend ActionMailer::AdvAttrAccessor
11
- self.protected_instance_variables.concat %w(@parts @mail_was_called @headers)
12
-
13
- # Specify the BCC addresses for the message
14
- adv_attr_accessor :bcc
15
-
16
- # Specify the CC addresses for the message.
17
- adv_attr_accessor :cc
18
-
19
- # Specify the charset to use for the message. This defaults to the
20
- # +default_charset+ specified for ActionMailer::Base.
21
- adv_attr_accessor :charset
22
-
23
- # Specify the content type for the message. This defaults to <tt>text/plain</tt>
24
- # in most cases, but can be automatically set in some situations.
25
- adv_attr_accessor :content_type
26
-
27
- # Specify the from address for the message.
28
- adv_attr_accessor :from
29
-
30
- # Specify the address (if different than the "from" address) to direct
31
- # replies to this message.
32
- adv_attr_accessor :reply_to
33
-
34
- # Specify the order in which parts should be sorted, based on content-type.
35
- # This defaults to the value for the +default_implicit_parts_order+.
36
- adv_attr_accessor :implicit_parts_order
37
-
38
- # Defaults to "1.0", but may be explicitly given if needed.
39
- adv_attr_accessor :mime_version
40
-
41
- # The recipient addresses for the message, either as a string (for a single
42
- # address) or an array (for multiple addresses).
43
- adv_attr_accessor :recipients, "Please pass :to as hash key to mail() instead"
44
-
45
- # The date on which the message was sent. If not set (the default), the
46
- # header will be set by the delivery agent.
47
- adv_attr_accessor :sent_on, "Please pass :date as hash key to mail() instead"
48
-
49
- # Specify the subject of the message.
50
- adv_attr_accessor :subject
51
-
52
- # Specify the template name to use for current message. This is the "base"
53
- # template name, without the extension or directory, and may be used to
54
- # have multiple mailer methods share the same template.
55
- adv_attr_accessor :template, "Please pass :template_name or :template_path as hash key to mail() instead"
56
-
57
- # Define the body of the message. This is either a Hash (in which case it
58
- # specifies the variables to pass to the template when it is rendered),
59
- # or a string, in which case it specifies the actual text of the message.
60
- adv_attr_accessor :body
61
- end
62
-
63
- def process(method_name, *args)
64
- initialize_defaults(method_name)
65
- super
66
- unless @mail_was_called
67
- create_parts
68
- create_mail
69
- end
70
- @_message
71
- end
72
-
73
- # Add a part to a multipart message, with the given content-type. The
74
- # part itself is yielded to the block so that other properties (charset,
75
- # body, headers, etc.) can be set on it.
76
- def part(params)
77
- ActiveSupport::Deprecation.warn "part() is deprecated and will be removed in future versions. " <<
78
- "Please pass a block to mail() instead."
79
- params = {:content_type => params} if String === params
80
-
81
- if custom_headers = params.delete(:headers)
82
- params.merge!(custom_headers)
83
- end
84
-
85
- part = Mail::Part.new(params)
86
-
87
- yield part if block_given?
88
- @parts << part
89
- end
90
-
91
- # Add an attachment to a multipart message. This is simply a part with the
92
- # content-disposition set to "attachment".
93
- def attachment(params, &block)
94
- ActiveSupport::Deprecation.warn "attachment() is deprecated and will be removed in future versions. " <<
95
- "Please use the attachments[] API instead."
96
- params = { :content_type => params } if String === params
97
-
98
- params[:content] ||= params.delete(:data) || params.delete(:body)
99
-
100
- if params[:filename]
101
- params = normalize_file_hash(params)
102
- else
103
- params = normalize_nonfile_hash(params)
104
- end
105
-
106
- part(params, &block)
107
- end
108
-
109
- protected
110
-
111
- def normalize_nonfile_hash(params)
112
- content_disposition = "attachment;"
113
-
114
- mime_type = params.delete(:mime_type)
115
-
116
- if content_type = params.delete(:content_type)
117
- content_type = "#{mime_type || content_type};"
118
- end
119
-
120
- params[:body] = params.delete(:data) if params[:data]
121
-
122
- { :content_type => content_type,
123
- :content_disposition => content_disposition }.merge(params)
124
- end
125
-
126
- def normalize_file_hash(params)
127
- filename = File.basename(params.delete(:filename))
128
- content_disposition = "attachment; filename=\"#{File.basename(filename)}\""
129
-
130
- mime_type = params.delete(:mime_type)
131
-
132
- if (content_type = params.delete(:content_type)) && (content_type !~ /filename=/)
133
- content_type = "#{mime_type || content_type}; filename=\"#{filename}\""
134
- end
135
-
136
- params[:body] = params.delete(:data) if params[:data]
137
-
138
- { :content_type => content_type,
139
- :content_disposition => content_disposition }.merge(params)
140
- end
141
-
142
- def create_mail
143
- m = @_message
144
-
145
- set_fields!({:subject => @subject, :to => @recipients, :from => @from,
146
- :bcc => @bcc, :cc => @cc, :reply_to => @reply_to}, @charset)
147
-
148
- m.mime_version = @mime_version if @mime_version
149
- m.date = @sent_on.to_time rescue @sent_on if @sent_on
150
-
151
- @headers.each { |k, v| m[k] = v }
152
-
153
- real_content_type, ctype_attrs = parse_content_type
154
- main_type, sub_type = split_content_type(real_content_type)
155
-
156
- if @parts.size == 1 && @parts.first.parts.empty?
157
- m.content_type([main_type, sub_type, ctype_attrs])
158
- m.body = @parts.first.body.encoded
159
- else
160
- @parts.each do |p|
161
- m.add_part(p)
162
- end
163
-
164
- m.body.set_sort_order(@implicit_parts_order)
165
- m.body.sort_parts!
166
-
167
- if real_content_type =~ /multipart/
168
- ctype_attrs.delete "charset"
169
- m.content_type([main_type, sub_type, ctype_attrs])
170
- end
171
- end
172
-
173
- wrap_delivery_behavior!
174
- m.content_transfer_encoding = '8bit' unless m.body.only_us_ascii?
175
-
176
- @_message
177
- end
178
-
179
- # Set up the default values for the various instance variables of this
180
- # mailer. Subclasses may override this method to provide different
181
- # defaults.
182
- def initialize_defaults(method_name)
183
- @charset ||= self.class.default[:charset].try(:dup)
184
- @content_type ||= self.class.default[:content_type].try(:dup)
185
- @implicit_parts_order ||= self.class.default[:parts_order].try(:dup)
186
- @mime_version ||= self.class.default[:mime_version].try(:dup)
187
-
188
- @cc, @bcc, @reply_to, @subject, @from, @recipients = nil, nil, nil, nil, nil, nil
189
-
190
- @mailer_name ||= self.class.mailer_name.dup
191
- @template ||= method_name
192
- @mail_was_called = false
193
-
194
- @parts ||= []
195
- @headers ||= {}
196
- @sent_on ||= Time.now
197
- @body ||= {}
198
- end
199
-
200
- def create_parts
201
- if String === @body
202
- @parts.unshift create_inline_part(@body)
203
- elsif @parts.empty? || @parts.all? { |p| p.content_disposition =~ /^attachment/ }
204
- lookup_context.find_all(@template, [@mailer_name]).each do |template|
205
- self.formats = template.formats
206
- @parts << create_inline_part(render(:template => template), template.mime_type)
207
- end
208
-
209
- if @parts.size > 1
210
- @content_type = "multipart/alternative" if @content_type !~ /^multipart/
211
- end
212
-
213
- # If this is a multipart e-mail add the mime_version if it is not
214
- # already set.
215
- @mime_version ||= "1.0" unless @parts.empty?
216
- end
217
- end
218
-
219
- def create_inline_part(body, mime_type=nil)
220
- ct = mime_type || "text/plain"
221
- main_type, sub_type = split_content_type(ct.to_s)
222
-
223
- Mail::Part.new(
224
- :content_type => [main_type, sub_type, {:charset => charset}],
225
- :content_disposition => "inline",
226
- :body => body
227
- )
228
- end
229
-
230
- def set_fields!(headers, charset) #:nodoc:
231
- m = @_message
232
- m.charset = charset
233
- m.subject ||= headers.delete(:subject) if headers[:subject]
234
- m.to ||= headers.delete(:to) if headers[:to]
235
- m.from ||= headers.delete(:from) if headers[:from]
236
- m.cc ||= headers.delete(:cc) if headers[:cc]
237
- m.bcc ||= headers.delete(:bcc) if headers[:bcc]
238
- m.reply_to ||= headers.delete(:reply_to) if headers[:reply_to]
239
- end
240
-
241
- def split_content_type(ct)
242
- ct.to_s.split("/")
243
- end
244
-
245
- def parse_content_type
246
- if @content_type.blank?
247
- [ nil, {} ]
248
- else
249
- ctype, *attrs = @content_type.split(/;\s*/)
250
- attrs = Hash[attrs.map { |attr| attr.split(/=/, 2) }]
251
- [ctype, {"charset" => @charset}.merge!(attrs)]
252
- end
253
- end
254
- end
255
- end
@@ -1,37 +0,0 @@
1
- module Mail
2
- class Message
3
-
4
- def set_content_type(*args)
5
- message = 'Message#set_content_type is deprecated, please just call ' <<
6
- 'Message#content_type with the same arguments'
7
- ActiveSupport::Deprecation.warn(message, caller[0,2])
8
- content_type(*args)
9
- end
10
-
11
- alias :old_transfer_encoding :transfer_encoding
12
- def transfer_encoding(value = nil)
13
- if value
14
- message = 'Message#transfer_encoding is deprecated, ' <<
15
- 'please call Message#content_transfer_encoding with the same arguments'
16
- ActiveSupport::Deprecation.warn(message, caller[0,2])
17
- content_transfer_encoding(value)
18
- else
19
- old_transfer_encoding
20
- end
21
- end
22
-
23
- def transfer_encoding=(value)
24
- message = 'Message#transfer_encoding= is deprecated, ' <<
25
- 'please call Message#content_transfer_encoding= with the same arguments'
26
- ActiveSupport::Deprecation.warn(message, caller[0,2])
27
- self.content_transfer_encoding = value
28
- end
29
-
30
- def original_filename
31
- message = 'Message#original_filename is deprecated, please call Message#filename'
32
- ActiveSupport::Deprecation.warn(message, caller[0,2])
33
- filename
34
- end
35
-
36
- end
37
- end