actionmailer 3.2.9 → 6.1.7.6
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +110 -17
- data/MIT-LICENSE +1 -2
- data/README.rdoc +39 -61
- data/lib/action_mailer/base.rb +599 -317
- data/lib/action_mailer/collector.rb +9 -7
- data/lib/action_mailer/delivery_job.rb +45 -0
- data/lib/action_mailer/delivery_methods.rb +33 -37
- data/lib/action_mailer/gem_version.rb +17 -0
- data/lib/action_mailer/inline_preview_interceptor.rb +57 -0
- data/lib/action_mailer/log_subscriber.rb +25 -8
- data/lib/action_mailer/mail_delivery_job.rb +43 -0
- data/lib/action_mailer/mail_helper.rb +29 -13
- data/lib/action_mailer/mail_with_error_handling.rb +10 -0
- data/lib/action_mailer/message_delivery.rb +178 -0
- data/lib/action_mailer/parameterized.rb +172 -0
- data/lib/action_mailer/preview.rb +142 -0
- data/lib/action_mailer/railtie.rb +48 -4
- data/lib/action_mailer/rescuable.rb +29 -0
- data/lib/action_mailer/test_case.rb +53 -14
- data/lib/action_mailer/test_helper.rb +114 -13
- data/lib/action_mailer/version.rb +8 -7
- data/lib/action_mailer.rb +37 -15
- data/lib/rails/generators/mailer/USAGE +6 -8
- data/lib/rails/generators/mailer/mailer_generator.rb +26 -4
- data/lib/rails/generators/mailer/templates/application_mailer.rb.tt +6 -0
- data/lib/rails/generators/mailer/templates/{mailer.rb → mailer.rb.tt} +3 -4
- metadata +105 -36
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 108f3c55ba55b639ad73688d53b9171c521de8f40dcad016babd5602b765743c
|
4
|
+
data.tar.gz: 3cb3c5659972171a6acc740ded03c04d949ede59a99e54e9bc37ae94db0106a2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 48d5ea4f1da22db3495b016ad056ab9f999b2badf04d4aa559b5028fd3ac529630831396c2c04a8acad4b211d4b865b0c0fa1f891c5ec8356310dc37b591804a
|
7
|
+
data.tar.gz: 22852825a97032541031e648936abff15db25b578a81746b6979f78db918e2a4ce3589d724d4f6baaf8f6639ffe25b631a56d7c29128b6bba7e8a5db3d7cf339
|
data/CHANGELOG.md
CHANGED
@@ -1,55 +1,148 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 6.1.7.6 (August 22, 2023) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 6.1.7.5 (August 22, 2023) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 6.1.7.4 (June 26, 2023) ##
|
12
|
+
|
13
|
+
* No changes.
|
14
|
+
|
15
|
+
|
16
|
+
## Rails 6.1.7.3 (March 13, 2023) ##
|
17
|
+
|
18
|
+
* No changes.
|
19
|
+
|
20
|
+
|
21
|
+
## Rails 6.1.7.2 (January 24, 2023) ##
|
22
|
+
|
23
|
+
* No changes.
|
24
|
+
|
25
|
+
|
26
|
+
## Rails 6.1.7.1 (January 17, 2023) ##
|
27
|
+
|
28
|
+
* No changes.
|
29
|
+
|
30
|
+
|
31
|
+
## Rails 6.1.7 (September 09, 2022) ##
|
32
|
+
|
33
|
+
* No changes.
|
34
|
+
|
35
|
+
|
36
|
+
## Rails 6.1.6.1 (July 12, 2022) ##
|
37
|
+
|
38
|
+
* No changes.
|
39
|
+
|
40
|
+
|
41
|
+
## Rails 6.1.6 (May 09, 2022) ##
|
42
|
+
|
43
|
+
* No changes.
|
44
|
+
|
45
|
+
|
46
|
+
## Rails 6.1.5.1 (April 26, 2022) ##
|
47
|
+
|
48
|
+
* No changes.
|
49
|
+
|
50
|
+
|
51
|
+
## Rails 6.1.5 (March 09, 2022) ##
|
52
|
+
|
53
|
+
* No changes.
|
54
|
+
|
55
|
+
|
56
|
+
## Rails 6.1.4.7 (March 08, 2022) ##
|
57
|
+
|
58
|
+
* No changes.
|
59
|
+
|
60
|
+
|
61
|
+
## Rails 6.1.4.6 (February 11, 2022) ##
|
62
|
+
|
63
|
+
* No changes.
|
64
|
+
|
65
|
+
|
66
|
+
## Rails 6.1.4.5 (February 11, 2022) ##
|
67
|
+
|
68
|
+
* No changes.
|
2
69
|
|
3
|
-
* Do not render views when mail() isn't called.
|
4
|
-
Fix #7761
|
5
70
|
|
6
|
-
|
71
|
+
## Rails 6.1.4.4 (December 15, 2021) ##
|
72
|
+
|
73
|
+
* No changes.
|
7
74
|
|
8
75
|
|
9
|
-
## Rails
|
76
|
+
## Rails 6.1.4.3 (December 14, 2021) ##
|
10
77
|
|
11
78
|
* No changes.
|
12
79
|
|
13
80
|
|
14
|
-
## Rails
|
81
|
+
## Rails 6.1.4.2 (December 14, 2021) ##
|
15
82
|
|
16
83
|
* No changes.
|
17
84
|
|
18
85
|
|
19
|
-
## Rails
|
86
|
+
## Rails 6.1.4.1 (August 19, 2021) ##
|
20
87
|
|
21
88
|
* No changes.
|
22
89
|
|
23
90
|
|
24
|
-
## Rails
|
91
|
+
## Rails 6.1.4 (June 24, 2021) ##
|
25
92
|
|
26
93
|
* No changes.
|
27
94
|
|
28
95
|
|
29
|
-
## Rails 3.2
|
96
|
+
## Rails 6.1.3.2 (May 05, 2021) ##
|
30
97
|
|
31
98
|
* No changes.
|
32
99
|
|
33
100
|
|
34
|
-
## Rails
|
101
|
+
## Rails 6.1.3.1 (March 26, 2021) ##
|
35
102
|
|
36
|
-
*
|
103
|
+
* No changes.
|
37
104
|
|
38
105
|
|
39
|
-
## Rails
|
106
|
+
## Rails 6.1.3 (February 17, 2021) ##
|
40
107
|
|
41
108
|
* No changes.
|
42
109
|
|
43
110
|
|
44
|
-
## Rails
|
111
|
+
## Rails 6.1.2.1 (February 10, 2021) ##
|
45
112
|
|
46
113
|
* No changes.
|
47
114
|
|
48
115
|
|
49
|
-
## Rails
|
116
|
+
## Rails 6.1.2 (February 09, 2021) ##
|
117
|
+
|
118
|
+
* No changes.
|
119
|
+
|
120
|
+
|
121
|
+
## Rails 6.1.1 (January 07, 2021) ##
|
122
|
+
|
123
|
+
* Sets default mailer queue to `"default"` in the mail assertions.
|
124
|
+
|
125
|
+
*Paul Keen*
|
126
|
+
|
127
|
+
|
128
|
+
## Rails 6.1.0 (December 09, 2020) ##
|
129
|
+
|
130
|
+
* Change default queue name of the deliver (`:mailers`) job to be the job adapter's
|
131
|
+
default (`:default`).
|
132
|
+
|
133
|
+
*Rafael Mendonça França*
|
134
|
+
|
135
|
+
* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
|
136
|
+
|
137
|
+
*Rafael Mendonça França*
|
138
|
+
|
139
|
+
* Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.
|
140
|
+
|
141
|
+
*bogdanvlviv*
|
142
|
+
|
143
|
+
* Added `email_address_with_name` to properly escape addresses with names.
|
50
144
|
|
51
|
-
*
|
145
|
+
*Sunny Ripert*
|
52
146
|
|
53
|
-
* Remove Old ActionMailer API *Josh Kalderimis*
|
54
147
|
|
55
|
-
Please check [
|
148
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionmailer/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2004-
|
1
|
+
Copyright (c) 2004-2022 David Heinemeier Hansson
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -18,4 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Action Mailer -- Easy email delivery and testing
|
2
2
|
|
3
|
-
Action Mailer is a framework for designing email
|
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, welcome
|
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.
|
@@ -13,6 +13,8 @@ Additionally, an Action Mailer class can be used to process incoming email,
|
|
13
13
|
such as allowing a blog to accept new posts from an email (which could even
|
14
14
|
have been sent from a phone).
|
15
15
|
|
16
|
+
You can read more about Action Mailer in the {Action Mailer Basics}[https://edgeguides.rubyonrails.org/action_mailer_basics.html] guide.
|
17
|
+
|
16
18
|
== Sending emails
|
17
19
|
|
18
20
|
The framework works by initializing any instance variables you want to be
|
@@ -22,12 +24,12 @@ the email.
|
|
22
24
|
This can be as simple as:
|
23
25
|
|
24
26
|
class Notifier < ActionMailer::Base
|
25
|
-
|
27
|
+
default from: 'system@loudthinking.com'
|
26
28
|
|
27
29
|
def welcome(recipient)
|
28
30
|
@recipient = recipient
|
29
|
-
mail(:
|
30
|
-
:
|
31
|
+
mail(to: recipient,
|
32
|
+
subject: "[Signed up] Welcome #{recipient}")
|
31
33
|
end
|
32
34
|
end
|
33
35
|
|
@@ -42,7 +44,7 @@ So the corresponding body template for the method above could look like this:
|
|
42
44
|
|
43
45
|
Thank you for signing up!
|
44
46
|
|
45
|
-
|
47
|
+
If the recipient was given as "david@loudthinking.com", the email
|
46
48
|
generated would look like this:
|
47
49
|
|
48
50
|
Date: Mon, 25 Jan 2010 22:48:09 +1100
|
@@ -61,77 +63,48 @@ generated would look like this:
|
|
61
63
|
|
62
64
|
Thank you for signing up!
|
63
65
|
|
64
|
-
In
|
65
|
-
<tt>deliver_method_name</tt>. Rails 3.0 has a much simpler interface, you
|
66
|
-
simply call the method and optionally call +deliver+ on the return value.
|
66
|
+
In order to send mails, you simply call the method and then call +deliver_now+ on the return value.
|
67
67
|
|
68
68
|
Calling the method returns a Mail Message object:
|
69
69
|
|
70
|
-
message = Notifier.welcome
|
71
|
-
message.
|
70
|
+
message = Notifier.welcome("david@loudthinking.com") # => Returns a Mail::Message object
|
71
|
+
message.deliver_now # => delivers the email
|
72
72
|
|
73
73
|
Or you can just chain the methods together like:
|
74
74
|
|
75
|
-
Notifier.welcome.
|
75
|
+
Notifier.welcome("david@loudthinking.com").deliver_now # Creates the email and sends it immediately
|
76
76
|
|
77
77
|
== Setting defaults
|
78
78
|
|
79
|
-
It is possible to set default values that will be used in every method in your
|
79
|
+
It is possible to set default values that will be used in every method in your
|
80
|
+
Action Mailer class. To implement this functionality, you just call the public
|
81
|
+
class method +default+ which you get for free from <tt>ActionMailer::Base</tt>.
|
82
|
+
This method accepts a Hash as the parameter. You can use any of the headers,
|
83
|
+
email messages have, like +:from+ as the key. You can also pass in a string as
|
84
|
+
the key, like "Content-Type", but Action Mailer does this out of the box for you,
|
85
|
+
so you won't need to worry about that. Finally, it is also possible to pass in a
|
86
|
+
Proc that will get evaluated when it is needed.
|
80
87
|
|
81
|
-
Note that every value you set with this method will get
|
88
|
+
Note that every value you set with this method will get overwritten if you use the
|
89
|
+
same key in your mailer method.
|
82
90
|
|
83
91
|
Example:
|
84
92
|
|
85
|
-
class
|
86
|
-
default :
|
93
|
+
class AuthenticationMailer < ActionMailer::Base
|
94
|
+
default from: "awesome@application.com", subject: Proc.new { "E-mail was generated at #{Time.now}" }
|
87
95
|
.....
|
88
96
|
end
|
89
97
|
|
90
|
-
== Receiving emails
|
91
|
-
|
92
|
-
To receive emails, you need to implement a public instance method called <tt>receive</tt> that takes an
|
93
|
-
email object as its single parameter. The Action Mailer framework has a corresponding class method,
|
94
|
-
which is also called <tt>receive</tt>, that accepts a raw, unprocessed email as a string, which it then turns
|
95
|
-
into the email object and calls the receive instance method.
|
96
|
-
|
97
|
-
Example:
|
98
|
-
|
99
|
-
class Mailman < ActionMailer::Base
|
100
|
-
def receive(email)
|
101
|
-
page = Page.find_by_address(email.to.first)
|
102
|
-
page.emails.create(
|
103
|
-
:subject => email.subject, :body => email.body
|
104
|
-
)
|
105
|
-
|
106
|
-
if email.has_attachments?
|
107
|
-
email.attachments.each do |attachment|
|
108
|
-
page.attachments.create({
|
109
|
-
:file => attachment, :description => email.subject
|
110
|
-
})
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
This Mailman can be the target for Postfix or other MTAs. In Rails, you would use the runner in the
|
117
|
-
trivial case like this:
|
118
|
-
|
119
|
-
rails runner 'Mailman.receive(STDIN.read)'
|
120
|
-
|
121
|
-
However, invoking Rails in the runner for each mail to be received is very resource intensive. A single
|
122
|
-
instance of Rails should be run within a daemon, if it is going to be utilized to process more than just
|
123
|
-
a limited number of email.
|
124
|
-
|
125
98
|
== Configuration
|
126
99
|
|
127
100
|
The Base class has the full list of configuration options. Here's an example:
|
128
101
|
|
129
102
|
ActionMailer::Base.smtp_settings = {
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
103
|
+
address: 'smtp.yourserver.com', # default: localhost
|
104
|
+
port: '25', # default: 25
|
105
|
+
user_name: 'user',
|
106
|
+
password: 'pass',
|
107
|
+
authentication: :plain # :plain, :login or :cram_md5
|
135
108
|
}
|
136
109
|
|
137
110
|
|
@@ -139,25 +112,30 @@ The Base class has the full list of configuration options. Here's an example:
|
|
139
112
|
|
140
113
|
The latest version of Action Mailer can be installed with RubyGems:
|
141
114
|
|
142
|
-
|
115
|
+
$ gem install actionmailer
|
143
116
|
|
144
|
-
Source code can be downloaded as part of the Rails project on GitHub
|
117
|
+
Source code can be downloaded as part of the Rails project on GitHub:
|
145
118
|
|
146
|
-
* https://github.com/rails/rails/tree/
|
119
|
+
* https://github.com/rails/rails/tree/main/actionmailer
|
147
120
|
|
148
121
|
|
149
122
|
== License
|
150
123
|
|
151
|
-
Action Mailer is released under the MIT license
|
124
|
+
Action Mailer is released under the MIT license:
|
125
|
+
|
126
|
+
* https://opensource.org/licenses/MIT
|
152
127
|
|
153
128
|
|
154
129
|
== Support
|
155
130
|
|
156
131
|
API documentation is at
|
157
132
|
|
158
|
-
*
|
133
|
+
* https://api.rubyonrails.org
|
159
134
|
|
160
|
-
Bug reports
|
135
|
+
Bug reports for the Ruby on Rails project can be filed here:
|
161
136
|
|
162
137
|
* https://github.com/rails/rails/issues
|
163
138
|
|
139
|
+
Feature requests should be discussed on the rails-core mailing list here:
|
140
|
+
|
141
|
+
* https://discuss.rubyonrails.org/c/rubyonrails-core
|