actionmailer 4.2.0.beta4 → 4.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcb1c9b3e5d724b79972d86938bb122153250793
4
- data.tar.gz: ddb546981d14586d13807d3ca1981b79762ce4a4
3
+ metadata.gz: 800efd649ee1a4c76b8156c66c3889abbecc3b02
4
+ data.tar.gz: cbd8ac503116232af6cbac98bc84ecf6700dfcf8
5
5
  SHA512:
6
- metadata.gz: a09fc1e03f6b257904225ae25bfd2a02f99326e5deb03a90fd858a797fd5ba015b4d32e916f383ccd9cf41f335d4539e2084e39c05d914f9fc881fde4c87e643
7
- data.tar.gz: b487d6808a402484d7d4f836a53503f5149bdcd1c94334ca98ecf6fbdb7716079aa13745c0a556c88fbcfd2af074681798e96de700586d23c6db70cbccc1413a
6
+ metadata.gz: be504a159dc18d224143486b07d77cfd4fdcc7847baaa1e6226fa84e02872c2fcb92cc9d5e67ed6b6114be0fcb21320e02f0772843fbe12251111879ce665d23
7
+ data.tar.gz: 18e6caed1d21195448f0932672367b560b4fe74ba52b081f3c95ea0b29e1e6541a76fc11c8f7050ab8d41aa047158b68c4804b48f6db2e1e2f17b9a944450d0d
@@ -1,30 +1,42 @@
1
- * Attachments can be added while rendering the mail template.
1
+ * `MailerGenerator` now generates layouts by default. The HTML mailer layout
2
+ now includes `<html>` and `<body>` tags which improve the spam rating in
3
+ some spam detection engines. Mailers now inherit from `ApplicationMailer`
4
+ which sets the default layout.
5
+
6
+ *Andy Jeffries*
7
+
8
+ * `link_to` and `url_for` now generate URLs by default in templates.
9
+ Passing `only_path: false` is no longer needed.
10
+
11
+ Fixes #16497 and #16589.
12
+
13
+ *Xavier Noria*, *Richard Schneeman*
14
+
15
+ * Attachments can now be added while rendering the mail template.
2
16
 
3
17
  Fixes #16974.
4
18
 
5
19
  *Christian Felder*
6
20
 
7
- * Added `#deliver_later`, `#deliver_now` and deprecate `#deliver` in favour of
8
- `#deliver_now`. `#deliver_later` will enqueue a job to render and deliver
9
- the mail instead of delivering it right at that moment. The job is enqueued
10
- using the new Active Job framework in Rails, and will use whatever queue is
11
- configured for Rails.
21
+ * Add `#deliver_later` and `#deliver_now` methods and deprecate `#deliver` in
22
+ favor of `#deliver_now`. `#deliver_later` will enqueue a job to render and
23
+ deliver the mail instead of delivering it immediately. The job is enqueued
24
+ using the new Active Job framework in Rails and will use the queue that you
25
+ have configured in Rails.
12
26
 
13
27
  *DHH*, *Abdelkader Boudih*, *Cristian Bica*
14
28
 
15
- * Make `ActionMailer::Previews` methods class methods. Previously they were
16
- instance methods and `ActionMailer` tries to render a message when they
17
- are called.
29
+ * `ActionMailer::Previews` are now class methods instead of instance methods.
18
30
 
19
31
  *Cristian Bica*
20
32
 
21
- * Deprecate `*_path` helpers in email views. When used they generate
22
- non-working links and are not the intention of most developers. Instead
23
- we recommend to use `*_url` helper.
33
+ * Deprecate `*_path` helpers in email views. They generated broken links in
34
+ email views and were not the intention of most developers. The `*_url`
35
+ helper is recommended instead.
24
36
 
25
37
  *Richard Schneeman*
26
38
 
27
- * Raise an exception when attachments are added after `mail` was called.
39
+ * Raise an exception when attachments are added after `mail` is called.
28
40
  This is a safeguard to prevent invalid emails.
29
41
 
30
42
  Fixes #16163.
@@ -33,10 +45,10 @@
33
45
 
34
46
  * Add `config.action_mailer.show_previews` configuration option.
35
47
 
36
- This config option can be used to enable the mail preview in environments
37
- other than development (such as staging).
48
+ This configuration option can be used to enable the mail preview in
49
+ environments other than development (such as staging).
38
50
 
39
- Defaults to `true` in development and false elsewhere.
51
+ Defaults to `true` in development and `false` elsewhere.
40
52
 
41
53
  *Leonard Garvey*
42
54
 
@@ -47,4 +59,5 @@
47
59
 
48
60
  *Yves Senn*
49
61
 
50
- Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md) for previous changes.
62
+ Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md)
63
+ for previous changes.
@@ -61,7 +61,7 @@ generated would look like this:
61
61
 
62
62
  Thank you for signing up!
63
63
 
64
- In order to send mails, you simply call the method and then call +deliver+ on the return value.
64
+ In order to send mails, you simply call the method and then call +deliver_now+ on the return value.
65
65
 
66
66
  Calling the method returns a Mail Message object:
67
67
 
@@ -74,9 +74,17 @@ Or you can just chain the methods together like:
74
74
 
75
75
  == Setting defaults
76
76
 
77
- It is possible to set default values that will be used in every method in your Action Mailer class. To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from <tt>ActionMailer::Base</tt>. This method accepts a Hash as the parameter. You can use any of the headers email messages have, like <tt>:from</tt> as the key. You can also pass in a string as the key, like "Content-Type", but Action Mailer does this out of the box for you, so you won't need to worry about that. Finally, it is also possible to pass in a Proc that will get evaluated when it is needed.
77
+ It is possible to set default values that will be used in every method in your
78
+ Action Mailer class. To implement this functionality, you just call the public
79
+ class method +default+ which you get for free from <tt>ActionMailer::Base</tt>.
80
+ This method accepts a Hash as the parameter. You can use any of the headers,
81
+ email messages have, like +:from+ as the key. You can also pass in a string as
82
+ the key, like "Content-Type", but Action Mailer does this out of the box for you,
83
+ so you won't need to worry about that. Finally, it is also possible to pass in a
84
+ Proc that will get evaluated when it is needed.
78
85
 
79
- Note that every value you set with this method will get overwritten if you use the same key in your mailer method.
86
+ Note that every value you set with this method will get overwritten if you use the
87
+ same key in your mailer method.
80
88
 
81
89
  Example:
82
90
 
@@ -87,10 +95,11 @@ Example:
87
95
 
88
96
  == Receiving emails
89
97
 
90
- To receive emails, you need to implement a public instance method called <tt>receive</tt> that takes an
91
- email object as its single parameter. The Action Mailer framework has a corresponding class method,
92
- which is also called <tt>receive</tt>, that accepts a raw, unprocessed email as a string, which it then turns
93
- into the email object and calls the receive instance method.
98
+ To receive emails, you need to implement a public instance method called
99
+ +receive+ that takes an email object as its single parameter. The Action Mailer
100
+ framework has a corresponding class method, which is also called +receive+, that
101
+ accepts a raw, unprocessed email as a string, which it then turns into the email
102
+ object and calls the receive instance method.
94
103
 
95
104
  Example:
96
105
 
@@ -111,13 +120,14 @@ Example:
111
120
  end
112
121
  end
113
122
 
114
- This Mailman can be the target for Postfix or other MTAs. In Rails, you would use the runner in the
115
- trivial case like this:
123
+ This Mailman can be the target for Postfix or other MTAs. In Rails, you would use
124
+ the runner in the trivial case like this:
116
125
 
117
126
  rails runner 'Mailman.receive(STDIN.read)'
118
127
 
119
- However, invoking Rails in the runner for each mail to be received is very resource intensive. A single
120
- instance of Rails should be run within a daemon, if it is going to process more than just a limited amount of email.
128
+ However, invoking Rails in the runner for each mail to be received is very
129
+ resource intensive. A single instance of Rails should be run within a daemon, if
130
+ it is going to process more than just a limited amount of email.
121
131
 
122
132
  == Configuration
123
133
 
@@ -15,11 +15,17 @@ module ActionMailer
15
15
  #
16
16
  # $ rails generate mailer Notifier
17
17
  #
18
- # The generated model inherits from <tt>ActionMailer::Base</tt>. A mailer model defines methods
18
+ # The generated model inherits from <tt>ApplicationMailer</tt> which in turn
19
+ # inherits from <tt>ActionMailer::Base</tt>. A mailer model defines methods
19
20
  # used to generate an email message. In these methods, you can setup variables to be used in
20
21
  # the mailer views, options on the mail itself such as the <tt>:from</tt> address, and attachments.
21
22
  #
22
- # class Notifier < ActionMailer::Base
23
+ # class ApplicationMailer < ActionMailer::Base
24
+ # default from: 'from@exmaple.com'
25
+ # layout 'mailer'
26
+ # end
27
+ #
28
+ # class Notifier < ApplicationMailer
23
29
  # default from: 'no-reply@example.com',
24
30
  # return_path: 'system@example.com'
25
31
  #
@@ -84,7 +90,7 @@ module ActionMailer
84
90
  # name as the method in your mailer model. For example, in the mailer defined above, the template at
85
91
  # <tt>app/views/notifier/welcome.text.erb</tt> would be used to generate the email.
86
92
  #
87
- # Variables defined in the methods of your mailer model are accessible as instance variables in their
93
+ # Variables defined in the methods of your mailer model are accessible as instance variables in their
88
94
  # corresponding view.
89
95
  #
90
96
  # Emails by default are sent in plain text, so a sample view for our model example might look like this:
@@ -178,7 +184,7 @@ module ActionMailer
178
184
  #
179
185
  # Sending attachment in emails is easy:
180
186
  #
181
- # class ApplicationMailer < ActionMailer::Base
187
+ # class Notifier < ApplicationMailer
182
188
  # def welcome(recipient)
183
189
  # attachments['free_book.pdf'] = File.read('path/to/file.pdf')
184
190
  # mail(to: recipient, subject: "New account information")
@@ -194,7 +200,7 @@ module ActionMailer
194
200
  # If you need to send attachments with no content, you need to create an empty view for it,
195
201
  # or add an empty body parameter like this:
196
202
  #
197
- # class ApplicationMailer < ActionMailer::Base
203
+ # class Notifier < ApplicationMailer
198
204
  # def welcome(recipient)
199
205
  # attachments['free_book.pdf'] = File.read('path/to/file.pdf')
200
206
  # mail(to: recipient, subject: "New account information", body: "")
@@ -206,7 +212,7 @@ module ActionMailer
206
212
  # You can also specify that a file should be displayed inline with other HTML. This is useful
207
213
  # if you want to display a corporate logo or a photo.
208
214
  #
209
- # class ApplicationMailer < ActionMailer::Base
215
+ # class Notifier < ApplicationMailer
210
216
  # def welcome(recipient)
211
217
  # attachments.inline['photo.png'] = File.read('path/to/photo.png')
212
218
  # mail(to: recipient, subject: "Here is what we look like")
@@ -245,7 +251,7 @@ module ActionMailer
245
251
  # Action Mailer provides some intelligent defaults for your emails, these are usually specified in a
246
252
  # default method inside the class definition:
247
253
  #
248
- # class Notifier < ActionMailer::Base
254
+ # class Notifier < ApplicationMailer
249
255
  # default sender: 'system@example.com'
250
256
  # end
251
257
  #
@@ -263,7 +269,7 @@ module ActionMailer
263
269
  # As you can pass in any header, you need to either quote the header as a string, or pass it in as
264
270
  # an underscored symbol, so the following will work:
265
271
  #
266
- # class Notifier < ActionMailer::Base
272
+ # class Notifier < ApplicationMailer
267
273
  # default 'Content-Transfer-Encoding' => '7bit',
268
274
  # content_description: 'This is a description'
269
275
  # end
@@ -271,7 +277,7 @@ module ActionMailer
271
277
  # Finally, Action Mailer also supports passing <tt>Proc</tt> objects into the default hash, so you
272
278
  # can define methods that evaluate as the message is being generated:
273
279
  #
274
- # class Notifier < ActionMailer::Base
280
+ # class Notifier < ApplicationMailer
275
281
  # default 'X-Special-Header' => Proc.new { my_method }
276
282
  #
277
283
  # private
@@ -296,7 +302,7 @@ module ActionMailer
296
302
  # This may be useful, for example, when you want to add default inline attachments for all
297
303
  # messages sent out by a certain mailer class:
298
304
  #
299
- # class Notifier < ActionMailer::Base
305
+ # class Notifier < ApplicationMailer
300
306
  # before_action :add_inline_attachment!
301
307
  #
302
308
  # def welcome
@@ -703,7 +709,7 @@ module ActionMailer
703
709
  # The main method that creates the message and renders the email templates. There are
704
710
  # two ways to call this method, with a block, or without a block.
705
711
  #
706
- # It accepts a headers hash. This hash allows you to specify
712
+ # It accepts a headers hash. This hash allows you to specify
707
713
  # the most used headers in an email message, these are:
708
714
  #
709
715
  # * +:subject+ - The subject of the message, if this is omitted, Action Mailer will
@@ -8,7 +8,7 @@ module ActionMailer
8
8
  MAJOR = 4
9
9
  MINOR = 2
10
10
  TINY = 0
11
- PRE = "beta4"
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -8,6 +8,7 @@ module Rails
8
8
 
9
9
  def create_mailer_file
10
10
  template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}.rb")
11
+ template "application_mailer.rb", 'app/mailers/application_mailer.rb'
11
12
  end
12
13
 
13
14
  hook_for :template_engine, :test_framework
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout 'mailer'
4
+ end
@@ -1,6 +1,5 @@
1
1
  <% module_namespacing do -%>
2
- class <%= class_name %> < ActionMailer::Base
3
- default from: "from@example.com"
2
+ class <%= class_name %> < ApplicationMailer
4
3
  <% actions.each do |action| -%>
5
4
 
6
5
  # Subject can be set in your I18n file at config/locales/en.yml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0.beta4
4
+ version: 4.2.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2014-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,82 +16,82 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0.beta4
19
+ version: 4.2.0.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.0.beta4
26
+ version: 4.2.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionview
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.2.0.beta4
33
+ version: 4.2.0.rc1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.2.0.beta4
40
+ version: 4.2.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activejob
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.2.0.beta4
47
+ version: 4.2.0.rc1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 4.2.0.beta4
54
+ version: 4.2.0.rc1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mail
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.5'
62
- - - '>='
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: 2.5.4
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ~>
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
71
  version: '2.5'
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 2.5.4
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rails-dom-testing
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '1.0'
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
- version: 1.0.4
84
+ version: 1.0.5
85
85
  type: :runtime
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ~>
89
+ - - "~>"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '1.0'
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: 1.0.4
94
+ version: 1.0.5
95
95
  description: Email on Rails. Compose, deliver, receive, and test emails using the
96
96
  familiar controller/view pattern. First-class support for multipart email and attachments.
97
97
  email: david@loudthinking.com
@@ -118,6 +118,7 @@ files:
118
118
  - lib/action_mailer/version.rb
119
119
  - lib/rails/generators/mailer/USAGE
120
120
  - lib/rails/generators/mailer/mailer_generator.rb
121
+ - lib/rails/generators/mailer/templates/application_mailer.rb
121
122
  - lib/rails/generators/mailer/templates/mailer.rb
122
123
  homepage: http://www.rubyonrails.org
123
124
  licenses:
@@ -129,18 +130,18 @@ require_paths:
129
130
  - lib
130
131
  required_ruby_version: !ruby/object:Gem::Requirement
131
132
  requirements:
132
- - - '>='
133
+ - - ">="
133
134
  - !ruby/object:Gem::Version
134
135
  version: 1.9.3
135
136
  required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  requirements:
137
- - - '>'
138
+ - - ">"
138
139
  - !ruby/object:Gem::Version
139
140
  version: 1.3.1
140
141
  requirements:
141
142
  - none
142
143
  rubyforge_project:
143
- rubygems_version: 2.2.1
144
+ rubygems_version: 2.2.2
144
145
  signing_key:
145
146
  specification_version: 4
146
147
  summary: Email composition, delivery, and receiving framework (part of Rails).