actionmailer 1.1.2 → 1.1.3

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.

data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ *1.1.3* (November 7th, 2005)
2
+
3
+ * Allow Mailers to have custom initialize methods that set default instance variables for all mail actions #2563 [mrj@bigpond.net.au]
4
+
5
+
1
6
  *1.1.2* (October 26th, 2005)
2
7
 
3
8
  * Upgraded to Action Pack 1.10.2
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  = Action Mailer -- Easy email delivery and testing
2
2
 
3
- Action Mailer is framework for designing email-service layers. These layers
3
+ Action Mailer is a framework for designing email-service layers. These layers
4
4
  are used to consolidate code for sending out forgotten passwords, welcoming
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.
@@ -145,4 +145,4 @@ And as Jim from Rake says:
145
145
  new feature to be submitted in the form of new unit tests.
146
146
 
147
147
  For other information, feel free to ask on the ruby-talk mailing list (which
148
- is mirrored to comp.lang.ruby) or contact mailto:david@loudthinking.com.
148
+ is mirrored to comp.lang.ruby) or contact mailto:david@loudthinking.com.
data/install.rb CHANGED
@@ -4,7 +4,7 @@ require 'ftools'
4
4
 
5
5
  include Config
6
6
 
7
- # this was adapted from rdoc's install.rb by ways of Log4r
7
+ # this was adapted from rdoc's install.rb by way of Log4r
8
8
 
9
9
  $sitedir = CONFIG["sitelibdir"]
10
10
  unless $sitedir
@@ -9,8 +9,8 @@ module ActionMailer
9
9
  #
10
10
  # class ApplicationMailer < ActionMailer::Base
11
11
  # # Set up properties
12
- # # (Properties can also be specified via accessor methods
13
- # # i.e. self.subject = "foo") and instance variables (@subject = "foo").
12
+ # # Properties can also be specified via accessor methods
13
+ # # (i.e. self.subject = "foo") and instance variables (@subject = "foo").
14
14
  # def signup_notification(recipient)
15
15
  # recipients recipient.email_address_with_name
16
16
  # subject "New account information"
@@ -71,7 +71,7 @@ module ActionMailer
71
71
  # end
72
72
  # end
73
73
  #
74
- # # After this post_notification will look for "templates/application_mailer/post_notification.rhtml"
74
+ # # After this, post_notification will look for "templates/application_mailer/post_notification.rhtml"
75
75
  # ApplicationMailer.template_root = "templates"
76
76
  #
77
77
  # ApplicationMailer.create_comment_notification(david, hello_world) # => a tmail object
@@ -87,11 +87,11 @@ module ActionMailer
87
87
  # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
88
88
  #
89
89
  # * <tt>server_settings</tt> - Allows detailed configuration of the server:
90
- # * <tt>:address</tt> Allows you to use a remote mail server. Just change it away from it's default "localhost" setting.
91
- # * <tt>:port</tt> On the off change that your mail server doesn't run on port 25, you can change it.
90
+ # * <tt>:address</tt> Allows you to use a remote mail server. Just change it from its default "localhost" setting.
91
+ # * <tt>:port</tt> On the off chance that your mail server doesn't run on port 25, you can change it.
92
92
  # * <tt>:domain</tt> If you need to specify a HELO domain, you can do it here.
93
- # * <tt>:user_name</tt> If your mail server requires authentication, set the username and password in these two settings.
94
- # * <tt>:password</tt> If your mail server requires authentication, set the username and password in these two settings.
93
+ # * <tt>:user_name</tt> If your mail server requires authentication, set the username in this setting.
94
+ # * <tt>:password</tt> If your mail server requires authentication, set the password in this setting.
95
95
  # * <tt>:authentication</tt> If your mail server requires authentication, you need to specify the authentication type here.
96
96
  # This is a symbol and one of :plain, :login, :cram_md5
97
97
  #
@@ -108,12 +108,12 @@ module ActionMailer
108
108
  #
109
109
  # * <tt>default_charset</tt> - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also
110
110
  # pick a different charset from inside a method with <tt>@charset</tt>.
111
- # * <tt>default_content_type</tt> - The default content type used for main part of the message. Defaults to "text/plain". You
111
+ # * <tt>default_content_type</tt> - The default content type used for the main part of the message. Defaults to "text/plain". You
112
112
  # can also pick a different content type from inside a method with <tt>@content_type</tt>.
113
113
  # * <tt>default_mime_version</tt> - The default mime version used for the message. Defaults to nil. You
114
114
  # can also pick a different value from inside a method with <tt>@mime_version</tt>. When multipart messages are in
115
115
  # use, <tt>@mime_version</tt> will be set to "1.0" if it is not set inside a method.
116
- # * <tt>default_implicit_parts_order</tt> - When a message is built implicitly (i.e. multiple parts are assemble from templates
116
+ # * <tt>default_implicit_parts_order</tt> - When a message is built implicitly (i.e. multiple parts are assembled from templates
117
117
  # which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to
118
118
  # ["text/html", "text/enriched", "text/plain"]. Items that appear first in the array have higher priority in the mail client
119
119
  # and appear last in the mime encoded message. You can also pick a different order from inside a method with
@@ -337,15 +337,14 @@ module ActionMailer
337
337
  # mailer. Subclasses may override this method to provide different
338
338
  # defaults.
339
339
  def initialize_defaults(method_name)
340
- @bcc = @cc = @from = @recipients = @sent_on = @subject = nil
341
- @charset = @@default_charset.dup
342
- @content_type = @@default_content_type.dup
343
- @implicit_parts_order = @@default_implicit_parts_order.dup
344
- @template = method_name
345
- @mailer_name = Inflector.underscore(self.class.name)
346
- @parts = []
347
- @headers = {}
348
- @body = {}
340
+ @charset ||= @@default_charset.dup
341
+ @content_type ||= @@default_content_type.dup
342
+ @implicit_parts_order ||= @@default_implicit_parts_order.dup
343
+ @template ||= method_name
344
+ @mailer_name ||= Inflector.underscore(self.class.name)
345
+ @parts ||= []
346
+ @headers ||= {}
347
+ @body ||= {}
349
348
  @mime_version = @@default_mime_version.dup if @@default_mime_version
350
349
  end
351
350
 
@@ -20,7 +20,7 @@ module ActionMailer
20
20
  attr_reader :parts
21
21
 
22
22
  # Add a part to a multipart message, with the given content-type. The
23
- # part itself is yielded to the block, so that other properties (charset,
23
+ # part itself is yielded to the block so that other properties (charset,
24
24
  # body, headers, etc.) can be set on it.
25
25
  def part(params)
26
26
  params = {:content_type => params} if String === params
@@ -2,7 +2,7 @@ module ActionMailer
2
2
  module Version #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/rakefile CHANGED
@@ -53,7 +53,7 @@ spec = Gem::Specification.new do |s|
53
53
  s.rubyforge_project = "actionmailer"
54
54
  s.homepage = "http://www.rubyonrails.org"
55
55
 
56
- s.add_dependency('actionpack', '= 1.10.2' + PKG_BUILD)
56
+ s.add_dependency('actionpack', '= 1.11.0' + PKG_BUILD)
57
57
 
58
58
  s.has_rdoc = true
59
59
  s.requirements << 'none'
@@ -111,6 +111,21 @@ class TestMailer < ActionMailer::Base
111
111
  end
112
112
  end
113
113
 
114
+ def multipart_with_utf8_subject(recipient)
115
+ recipients recipient
116
+ subject "Foo áëô îü"
117
+ from "test@example.com"
118
+ charset "utf-8"
119
+
120
+ part "text/plain" do |p|
121
+ p.body = "blah"
122
+ end
123
+
124
+ part "text/html" do |p|
125
+ p.body = "<b>blah</b>"
126
+ end
127
+ end
128
+
114
129
  def explicitly_multipart_example(recipient, ct=nil)
115
130
  recipients recipient
116
131
  subject "multipart example"
@@ -580,6 +595,11 @@ EOF
580
595
  mail = TestMailer.create_multipart_with_mime_version(@recipient)
581
596
  assert_equal "1.1", mail.mime_version
582
597
  end
598
+
599
+ def test_multipart_with_utf8_subject
600
+ mail = TestMailer.create_multipart_with_utf8_subject(@recipient)
601
+ assert_match(/\nSubject: =\?utf-8\?Q\?Foo_.*?\?=/, mail.encoded)
602
+ end
583
603
 
584
604
  def test_explicitly_multipart_messages
585
605
  mail = TestMailer.create_explicitly_multipart_example(@recipient)
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: actionmailer
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.2
7
- date: 2005-10-26 00:00:00 +02:00
6
+ version: 1.1.3
7
+ date: 2005-11-07 00:00:00 +01:00
8
8
  summary: Service layer for easy email delivery and testing.
9
9
  require_paths:
10
10
  - lib
@@ -120,5 +120,5 @@ dependencies:
120
120
  -
121
121
  - "="
122
122
  - !ruby/object:Gem::Version
123
- version: 1.10.2
123
+ version: 1.11.0
124
124
  version: