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 +5 -0
- data/README +2 -2
- data/install.rb +1 -1
- data/lib/action_mailer/base.rb +17 -18
- data/lib/action_mailer/part_container.rb +1 -1
- data/lib/action_mailer/version.rb +1 -1
- data/rakefile +1 -1
- data/test/mail_service_test.rb +20 -0
- metadata +3 -3
data/CHANGELOG
CHANGED
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
data/lib/action_mailer/base.rb
CHANGED
@@ -9,8 +9,8 @@ module ActionMailer
|
|
9
9
|
#
|
10
10
|
# class ApplicationMailer < ActionMailer::Base
|
11
11
|
# # Set up properties
|
12
|
-
# #
|
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
|
91
|
-
# * <tt>:port</tt> On the off
|
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
|
94
|
-
# * <tt>:password</tt> If your mail server requires authentication, set the
|
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
|
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
|
-
@
|
341
|
-
@
|
342
|
-
@
|
343
|
-
@
|
344
|
-
@
|
345
|
-
@
|
346
|
-
@
|
347
|
-
@
|
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
|
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
|
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.
|
56
|
+
s.add_dependency('actionpack', '= 1.11.0' + PKG_BUILD)
|
57
57
|
|
58
58
|
s.has_rdoc = true
|
59
59
|
s.requirements << 'none'
|
data/test/mail_service_test.rb
CHANGED
@@ -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.
|
7
|
-
date: 2005-
|
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.
|
123
|
+
version: 1.11.0
|
124
124
|
version:
|