actionmailer 6.0.6.1 → 6.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -213
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/action_mailer/base.rb +47 -41
- data/lib/action_mailer/delivery_job.rb +1 -1
- data/lib/action_mailer/delivery_methods.rb +1 -1
- data/lib/action_mailer/gem_version.rb +3 -3
- data/lib/action_mailer/log_subscriber.rb +0 -6
- data/lib/action_mailer/message_delivery.rb +28 -1
- data/lib/action_mailer/preview.rb +1 -1
- data/lib/action_mailer/railtie.rb +0 -5
- data/lib/action_mailer.rb +2 -1
- data/lib/rails/generators/mailer/USAGE +2 -3
- metadata +31 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d4b88a559c73fca2800a4836695e839a7ee25a582aa3225157862e061615a03
|
4
|
+
data.tar.gz: 479c4ec15e1d92601f7bc7077fbb2651db0214e47ab5c344878b5374f8cfedeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f39407ca196f123cdff83a0854303de0e527b62c20f0eb66f3273f88275037a6953e6622276cd63ff45ce887509ecab71a03569c8729e2351cfc57d0631ec97d
|
7
|
+
data.tar.gz: 7a63ac2f6470c079a3458e9cde60522ccd4b07fd881de3635e80ee2244f07d03184774767979680d0ba67a526cad6db4518d00ab210aea4777368e12a96808b7
|
data/CHANGELOG.md
CHANGED
@@ -1,223 +1,16 @@
|
|
1
|
-
## Rails 6.0.
|
1
|
+
## Rails 6.1.0.rc1 (November 02, 2020) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
|
4
4
|
|
5
|
-
|
6
|
-
## Rails 6.0.6 (September 09, 2022) ##
|
7
|
-
|
8
|
-
* No changes.
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 6.0.5.1 (July 12, 2022) ##
|
12
|
-
|
13
|
-
* No changes.
|
14
|
-
|
15
|
-
|
16
|
-
## Rails 6.0.5 (May 09, 2022) ##
|
17
|
-
|
18
|
-
* No changes.
|
19
|
-
|
20
|
-
|
21
|
-
## Rails 6.0.4.8 (April 26, 2022) ##
|
22
|
-
|
23
|
-
* No changes.
|
24
|
-
|
25
|
-
|
26
|
-
## Rails 6.0.4.7 (March 08, 2022) ##
|
27
|
-
|
28
|
-
* No changes.
|
29
|
-
|
30
|
-
|
31
|
-
## Rails 6.0.4.6 (February 11, 2022) ##
|
32
|
-
|
33
|
-
* No changes.
|
34
|
-
|
35
|
-
|
36
|
-
## Rails 6.0.4.5 (February 11, 2022) ##
|
37
|
-
|
38
|
-
* No changes.
|
39
|
-
|
40
|
-
|
41
|
-
## Rails 6.0.4.4 (December 15, 2021) ##
|
42
|
-
|
43
|
-
* No changes.
|
44
|
-
|
45
|
-
|
46
|
-
## Rails 6.0.4.3 (December 14, 2021) ##
|
47
|
-
|
48
|
-
* No changes.
|
49
|
-
|
50
|
-
|
51
|
-
## Rails 6.0.4.2 (December 14, 2021) ##
|
52
|
-
|
53
|
-
* No changes.
|
54
|
-
|
55
|
-
|
56
|
-
## Rails 6.0.4.1 (August 19, 2021) ##
|
57
|
-
|
58
|
-
* No changes.
|
59
|
-
|
60
|
-
|
61
|
-
## Rails 6.0.4 (June 15, 2021) ##
|
62
|
-
|
63
|
-
* No changes.
|
64
|
-
|
65
|
-
|
66
|
-
## Rails 6.0.3.7 (May 05, 2021) ##
|
67
|
-
|
68
|
-
* No changes.
|
69
|
-
|
70
|
-
|
71
|
-
## Rails 6.0.3.6 (March 26, 2021) ##
|
72
|
-
|
73
|
-
* No changes.
|
74
|
-
|
75
|
-
|
76
|
-
## Rails 6.0.3.5 (February 10, 2021) ##
|
77
|
-
|
78
|
-
* No changes.
|
79
|
-
|
80
|
-
|
81
|
-
## Rails 6.0.3.4 (October 07, 2020) ##
|
82
|
-
|
83
|
-
* No changes.
|
84
|
-
|
85
|
-
|
86
|
-
## Rails 6.0.3.3 (September 09, 2020) ##
|
87
|
-
|
88
|
-
* No changes.
|
89
|
-
|
90
|
-
|
91
|
-
## Rails 6.0.3.2 (June 17, 2020) ##
|
92
|
-
|
93
|
-
* No changes.
|
94
|
-
|
95
|
-
|
96
|
-
## Rails 6.0.3.1 (May 18, 2020) ##
|
97
|
-
|
98
|
-
* No changes.
|
99
|
-
|
100
|
-
|
101
|
-
## Rails 6.0.3 (May 06, 2020) ##
|
102
|
-
|
103
|
-
* No changes.
|
104
|
-
|
105
|
-
|
106
|
-
## Rails 6.0.2.2 (March 19, 2020) ##
|
107
|
-
|
108
|
-
* No changes.
|
109
|
-
|
110
|
-
|
111
|
-
## Rails 6.0.2.1 (December 18, 2019) ##
|
112
|
-
|
113
|
-
* No changes.
|
114
|
-
|
115
|
-
|
116
|
-
## Rails 6.0.2 (December 13, 2019) ##
|
5
|
+
*Rafael Mendonça França*
|
117
6
|
|
118
7
|
* Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.
|
119
8
|
|
120
9
|
*bogdanvlviv*
|
121
10
|
|
11
|
+
* Added `email_address_with_name` to properly escape addresses with names.
|
122
12
|
|
123
|
-
|
124
|
-
|
125
|
-
* No changes.
|
126
|
-
|
127
|
-
|
128
|
-
## Rails 6.0.0 (August 16, 2019) ##
|
129
|
-
|
130
|
-
* No changes.
|
131
|
-
|
132
|
-
|
133
|
-
## Rails 6.0.0.rc2 (July 22, 2019) ##
|
134
|
-
|
135
|
-
* No changes.
|
136
|
-
|
137
|
-
|
138
|
-
## Rails 6.0.0.rc1 (April 24, 2019) ##
|
139
|
-
|
140
|
-
* No changes.
|
141
|
-
|
142
|
-
|
143
|
-
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
144
|
-
|
145
|
-
* No changes.
|
146
|
-
|
147
|
-
|
148
|
-
## Rails 6.0.0.beta2 (February 25, 2019) ##
|
149
|
-
|
150
|
-
* No changes.
|
151
|
-
|
152
|
-
|
153
|
-
## Rails 6.0.0.beta1 (January 18, 2019) ##
|
154
|
-
|
155
|
-
* Deprecate `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
|
156
|
-
|
157
|
-
*George Claghorn*
|
158
|
-
|
159
|
-
* Add `MailDeliveryJob` for delivering both regular and parameterized mail. Deprecate using `DeliveryJob` and `Parameterized::DeliveryJob`.
|
160
|
-
|
161
|
-
*Gannon McGibbon*
|
162
|
-
|
163
|
-
* Fix ActionMailer assertions not working when a Mail defines
|
164
|
-
a custom delivery job class
|
165
|
-
|
166
|
-
*Edouard Chin*
|
167
|
-
|
168
|
-
* Mails with multipart `format` blocks with implicit render now also check for
|
169
|
-
a template name in options hash instead of only using the action name.
|
170
|
-
|
171
|
-
*Marcus Ilgner*
|
172
|
-
|
173
|
-
* `ActionDispatch::IntegrationTest` includes `ActionMailer::TestHelper` module by default.
|
174
|
-
|
175
|
-
*Ricardo Díaz*
|
176
|
-
|
177
|
-
* Add `perform_deliveries` to a payload of `deliver.action_mailer` notification.
|
178
|
-
|
179
|
-
*Yoshiyuki Kinjo*
|
180
|
-
|
181
|
-
* Change delivery logging message when `perform_deliveries` is false.
|
182
|
-
|
183
|
-
*Yoshiyuki Kinjo*
|
184
|
-
|
185
|
-
* Allow call `assert_enqueued_email_with` with no block.
|
186
|
-
|
187
|
-
Example:
|
188
|
-
```
|
189
|
-
def test_email
|
190
|
-
ContactMailer.welcome.deliver_later
|
191
|
-
assert_enqueued_email_with ContactMailer, :welcome
|
192
|
-
end
|
193
|
-
|
194
|
-
def test_email_with_arguments
|
195
|
-
ContactMailer.welcome("Hello", "Goodbye").deliver_later
|
196
|
-
assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"]
|
197
|
-
end
|
198
|
-
```
|
199
|
-
|
200
|
-
*bogdanvlviv*
|
201
|
-
|
202
|
-
* Ensure mail gem is eager autoloaded when eager load is true to prevent thread deadlocks.
|
203
|
-
|
204
|
-
*Samuel Cochran*
|
205
|
-
|
206
|
-
* Perform email jobs in `assert_emails`.
|
207
|
-
|
208
|
-
*Gannon McGibbon*
|
209
|
-
|
210
|
-
* Add `Base.unregister_observer`, `Base.unregister_observers`,
|
211
|
-
`Base.unregister_interceptor`, `Base.unregister_interceptors`,
|
212
|
-
`Base.unregister_preview_interceptor` and `Base.unregister_preview_interceptors`.
|
213
|
-
This makes it possible to dynamically add and remove email observers and
|
214
|
-
interceptors at runtime in the same way they're registered.
|
215
|
-
|
216
|
-
*Claudio Ortolina*, *Kota Miyake*
|
217
|
-
|
218
|
-
* Rails 6 requires Ruby 2.5.0 or newer.
|
219
|
-
|
220
|
-
*Jeremy Daer*, *Kasper Timm Hansen*
|
13
|
+
*Sunny Ripert*
|
221
14
|
|
222
15
|
|
223
|
-
Please check [
|
16
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionmailer/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -116,7 +116,7 @@ The latest version of Action Mailer can be installed with RubyGems:
|
|
116
116
|
|
117
117
|
Source code can be downloaded as part of the Rails project on GitHub:
|
118
118
|
|
119
|
-
* https://github.com/rails/rails/tree/
|
119
|
+
* https://github.com/rails/rails/tree/master/actionmailer
|
120
120
|
|
121
121
|
|
122
122
|
== License
|
data/lib/action_mailer/base.rb
CHANGED
@@ -16,11 +16,11 @@ module ActionMailer
|
|
16
16
|
#
|
17
17
|
# To use Action Mailer, you need to create a mailer model.
|
18
18
|
#
|
19
|
-
# $ rails generate mailer Notifier
|
19
|
+
# $ bin/rails generate mailer Notifier
|
20
20
|
#
|
21
21
|
# The generated model inherits from <tt>ApplicationMailer</tt> which in turn
|
22
22
|
# inherits from <tt>ActionMailer::Base</tt>. A mailer model defines methods
|
23
|
-
# used to generate an email message. In these methods, you can
|
23
|
+
# used to generate an email message. In these methods, you can set up variables to be used in
|
24
24
|
# the mailer views, options on the mail itself such as the <tt>:from</tt> address, and attachments.
|
25
25
|
#
|
26
26
|
# class ApplicationMailer < ActionMailer::Base
|
@@ -455,10 +455,6 @@ module ActionMailer
|
|
455
455
|
|
456
456
|
PROTECTED_IVARS = AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES + [:@_action_has_layout]
|
457
457
|
|
458
|
-
def _protected_ivars # :nodoc:
|
459
|
-
PROTECTED_IVARS
|
460
|
-
end
|
461
|
-
|
462
458
|
helper ActionMailer::MailHelper
|
463
459
|
|
464
460
|
class_attribute :delivery_job, default: ::ActionMailer::DeliveryJob
|
@@ -551,32 +547,6 @@ module ActionMailer
|
|
551
547
|
# config.action_mailer.default_options = { from: "no-reply@example.org" }
|
552
548
|
alias :default_options= :default
|
553
549
|
|
554
|
-
# Receives a raw email, parses it into an email object, decodes it,
|
555
|
-
# instantiates a new mailer, and passes the email object to the mailer
|
556
|
-
# object's +receive+ method.
|
557
|
-
#
|
558
|
-
# If you want your mailer to be able to process incoming messages, you'll
|
559
|
-
# need to implement a +receive+ method that accepts the raw email string
|
560
|
-
# as a parameter:
|
561
|
-
#
|
562
|
-
# class MyMailer < ActionMailer::Base
|
563
|
-
# def receive(mail)
|
564
|
-
# # ...
|
565
|
-
# end
|
566
|
-
# end
|
567
|
-
def receive(raw_mail)
|
568
|
-
ActiveSupport::Deprecation.warn(<<~MESSAGE.squish)
|
569
|
-
ActionMailer::Base.receive is deprecated and will be removed in Rails 6.1.
|
570
|
-
Use Action Mailbox to process inbound email.
|
571
|
-
MESSAGE
|
572
|
-
|
573
|
-
ActiveSupport::Notifications.instrument("receive.action_mailer") do |payload|
|
574
|
-
mail = Mail.new(raw_mail)
|
575
|
-
set_payload_for_mail(payload, mail)
|
576
|
-
new.receive(mail)
|
577
|
-
end
|
578
|
-
end
|
579
|
-
|
580
550
|
# Wraps an email delivery inside of <tt>ActiveSupport::Notifications</tt> instrumentation.
|
581
551
|
#
|
582
552
|
# This method is actually called by the <tt>Mail::Message</tt> object itself
|
@@ -590,6 +560,14 @@ module ActionMailer
|
|
590
560
|
end
|
591
561
|
end
|
592
562
|
|
563
|
+
# Returns an email in the format "Name <email@example.com>".
|
564
|
+
def email_address_with_name(address, name)
|
565
|
+
Mail::Address.new.tap do |builder|
|
566
|
+
builder.address = address
|
567
|
+
builder.display_name = name
|
568
|
+
end.to_s
|
569
|
+
end
|
570
|
+
|
593
571
|
private
|
594
572
|
def set_payload_for_mail(payload, mail)
|
595
573
|
payload[:mail] = mail.encoded
|
@@ -657,6 +635,11 @@ module ActionMailer
|
|
657
635
|
self.class.mailer_name
|
658
636
|
end
|
659
637
|
|
638
|
+
# Returns an email in the format "Name <email@example.com>".
|
639
|
+
def email_address_with_name(address, name)
|
640
|
+
self.class.email_address_with_name(address, name)
|
641
|
+
end
|
642
|
+
|
660
643
|
# Allows you to pass random and unusual headers to the new <tt>Mail::Message</tt>
|
661
644
|
# object which will add them to itself.
|
662
645
|
#
|
@@ -738,7 +721,7 @@ module ActionMailer
|
|
738
721
|
end
|
739
722
|
|
740
723
|
class LateAttachmentsProxy < SimpleDelegator
|
741
|
-
def inline;
|
724
|
+
def inline; self end
|
742
725
|
def []=(_name, _content); _raise_error end
|
743
726
|
|
744
727
|
private
|
@@ -859,8 +842,9 @@ module ActionMailer
|
|
859
842
|
@_mail_was_called = true
|
860
843
|
|
861
844
|
create_parts_from_responses(message, responses)
|
845
|
+
wrap_inline_attachments(message)
|
862
846
|
|
863
|
-
#
|
847
|
+
# Set up content type, reapply charset and handle parts order
|
864
848
|
message.content_type = set_content_type(message, content_type, headers[:content_type])
|
865
849
|
message.charset = charset
|
866
850
|
|
@@ -888,7 +872,7 @@ module ActionMailer
|
|
888
872
|
when user_content_type.present?
|
889
873
|
user_content_type
|
890
874
|
when m.has_attachments?
|
891
|
-
if m.attachments.
|
875
|
+
if m.attachments.all?(&:inline?)
|
892
876
|
["multipart", "related", params]
|
893
877
|
else
|
894
878
|
["multipart", "mixed", params]
|
@@ -915,12 +899,9 @@ module ActionMailer
|
|
915
899
|
end
|
916
900
|
|
917
901
|
def apply_defaults(headers)
|
918
|
-
default_values = self.class.default.
|
919
|
-
|
920
|
-
|
921
|
-
compute_default(value)
|
922
|
-
]
|
923
|
-
end.to_h
|
902
|
+
default_values = self.class.default.transform_values do |value|
|
903
|
+
compute_default(value)
|
904
|
+
end
|
924
905
|
|
925
906
|
headers_with_defaults = headers.reverse_merge(default_values)
|
926
907
|
headers_with_defaults[:subject] ||= default_i18n_subject
|
@@ -989,6 +970,27 @@ module ActionMailer
|
|
989
970
|
end
|
990
971
|
end
|
991
972
|
|
973
|
+
def wrap_inline_attachments(message)
|
974
|
+
# If we have both types of attachment, wrap all the inline attachments
|
975
|
+
# in multipart/related, but not the actual attachments
|
976
|
+
if message.attachments.detect(&:inline?) && message.attachments.detect { |a| !a.inline? }
|
977
|
+
related = Mail::Part.new
|
978
|
+
related.content_type = "multipart/related"
|
979
|
+
mixed = [ related ]
|
980
|
+
|
981
|
+
message.parts.each do |p|
|
982
|
+
if p.attachment? && !p.inline?
|
983
|
+
mixed << p
|
984
|
+
else
|
985
|
+
related.add_part(p)
|
986
|
+
end
|
987
|
+
end
|
988
|
+
|
989
|
+
message.parts.clear
|
990
|
+
mixed.each { |c| message.add_part(c) }
|
991
|
+
end
|
992
|
+
end
|
993
|
+
|
992
994
|
def create_parts_from_responses(m, responses)
|
993
995
|
if responses.size == 1 && !m.has_attachments?
|
994
996
|
responses[0].each { |k, v| m[k] = v }
|
@@ -1020,6 +1022,10 @@ module ActionMailer
|
|
1020
1022
|
"action_mailer"
|
1021
1023
|
end
|
1022
1024
|
|
1025
|
+
def _protected_ivars
|
1026
|
+
PROTECTED_IVARS
|
1027
|
+
end
|
1028
|
+
|
1023
1029
|
ActiveSupport.run_load_hooks(:action_mailer, self)
|
1024
1030
|
end
|
1025
1031
|
end
|
@@ -15,7 +15,7 @@ module ActionMailer
|
|
15
15
|
before_perform do
|
16
16
|
ActiveSupport::Deprecation.warn <<~MSG.squish
|
17
17
|
Sending mail with DeliveryJob and Parameterized::DeliveryJob
|
18
|
-
is deprecated and will be removed in Rails 6.
|
18
|
+
is deprecated and will be removed in Rails 6.2.
|
19
19
|
Please use MailDeliveryJob instead.
|
20
20
|
MSG
|
21
21
|
end
|
@@ -49,7 +49,7 @@ module ActionMailer
|
|
49
49
|
# arguments: '-i'
|
50
50
|
def add_delivery_method(symbol, klass, default_options = {})
|
51
51
|
class_attribute(:"#{symbol}_settings") unless respond_to?(:"#{symbol}_settings")
|
52
|
-
|
52
|
+
public_send(:"#{symbol}_settings=", default_options)
|
53
53
|
self.delivery_methods = delivery_methods.merge(symbol.to_sym => klass).freeze
|
54
54
|
end
|
55
55
|
|
@@ -20,12 +20,6 @@ module ActionMailer
|
|
20
20
|
debug { event.payload[:mail] }
|
21
21
|
end
|
22
22
|
|
23
|
-
# An email was received.
|
24
|
-
def receive(event)
|
25
|
-
info { "Received mail (#{event.duration.round(1)}ms)" }
|
26
|
-
debug { event.payload[:mail] }
|
27
|
-
end
|
28
|
-
|
29
23
|
# An email was generated.
|
30
24
|
def process(event)
|
31
25
|
debug do
|
@@ -53,12 +53,14 @@ module ActionMailer
|
|
53
53
|
# Notifier.welcome(User.first).deliver_later!
|
54
54
|
# Notifier.welcome(User.first).deliver_later!(wait: 1.hour)
|
55
55
|
# Notifier.welcome(User.first).deliver_later!(wait_until: 10.hours.from_now)
|
56
|
+
# Notifier.welcome(User.first).deliver_later!(priority: 10)
|
56
57
|
#
|
57
58
|
# Options:
|
58
59
|
#
|
59
60
|
# * <tt>:wait</tt> - Enqueue the email to be delivered with a delay
|
60
61
|
# * <tt>:wait_until</tt> - Enqueue the email to be delivered at (after) a specific date / time
|
61
62
|
# * <tt>:queue</tt> - Enqueue the email on the specified queue
|
63
|
+
# * <tt>:priority</tt> - Enqueues the email with the specified priority
|
62
64
|
#
|
63
65
|
# By default, the email will be enqueued using <tt>ActionMailer::DeliveryJob</tt>. Each
|
64
66
|
# <tt>ActionMailer::Base</tt> class can specify the job to use by setting the class variable
|
@@ -77,12 +79,14 @@ module ActionMailer
|
|
77
79
|
# Notifier.welcome(User.first).deliver_later
|
78
80
|
# Notifier.welcome(User.first).deliver_later(wait: 1.hour)
|
79
81
|
# Notifier.welcome(User.first).deliver_later(wait_until: 10.hours.from_now)
|
82
|
+
# Notifier.welcome(User.first).deliver_later(priority: 10)
|
80
83
|
#
|
81
84
|
# Options:
|
82
85
|
#
|
83
86
|
# * <tt>:wait</tt> - Enqueue the email to be delivered with a delay.
|
84
87
|
# * <tt>:wait_until</tt> - Enqueue the email to be delivered at (after) a specific date / time.
|
85
88
|
# * <tt>:queue</tt> - Enqueue the email on the specified queue.
|
89
|
+
# * <tt>:priority</tt> - Enqueues the email with the specified priority
|
86
90
|
#
|
87
91
|
# By default, the email will be enqueued using <tt>ActionMailer::DeliveryJob</tt>. Each
|
88
92
|
# <tt>ActionMailer::Base</tt> class can specify the job to use by setting the class variable
|
@@ -138,14 +142,37 @@ module ActionMailer
|
|
138
142
|
else
|
139
143
|
job = @mailer_class.delivery_job
|
140
144
|
|
141
|
-
if job
|
145
|
+
if use_new_args?(job)
|
142
146
|
job.set(options).perform_later(
|
143
147
|
@mailer_class.name, @action.to_s, delivery_method.to_s, args: @args)
|
148
|
+
elsif job <= DeliveryJob
|
149
|
+
job.set(options).perform_later(
|
150
|
+
@mailer_class.name, @action.to_s, delivery_method.to_s, *@args)
|
144
151
|
else
|
152
|
+
ActiveSupport::Deprecation.warn(<<~EOM)
|
153
|
+
In Rails 6.2, Action Mailer will pass the mail arguments inside the `:args` keyword argument.
|
154
|
+
The `perform` method of the #{job} needs to change and forward the mail arguments
|
155
|
+
from the `args` keyword argument.
|
156
|
+
|
157
|
+
The `perform` method should now look like:
|
158
|
+
|
159
|
+
`def perform(mailer, mail_method, delivery, args:)`
|
160
|
+
EOM
|
161
|
+
|
145
162
|
job.set(options).perform_later(
|
146
163
|
@mailer_class.name, @action.to_s, delivery_method.to_s, *@args)
|
147
164
|
end
|
148
165
|
end
|
149
166
|
end
|
167
|
+
|
168
|
+
def use_new_args?(job)
|
169
|
+
parameters = job.public_instance_method(:perform).parameters
|
170
|
+
|
171
|
+
parameters.find do |key, name|
|
172
|
+
return true if key == :keyreq && name == :args
|
173
|
+
|
174
|
+
key == :keyrest
|
175
|
+
end
|
176
|
+
end
|
150
177
|
end
|
151
178
|
end
|
@@ -18,11 +18,6 @@ module ActionMailer
|
|
18
18
|
paths = app.config.paths
|
19
19
|
options = app.config.action_mailer
|
20
20
|
|
21
|
-
if app.config.force_ssl
|
22
|
-
options.default_url_options ||= {}
|
23
|
-
options.default_url_options[:protocol] ||= "https"
|
24
|
-
end
|
25
|
-
|
26
21
|
options.assets_dir ||= paths["public"].first
|
27
22
|
options.javascripts_dir ||= paths["public/javascripts"].first
|
28
23
|
options.stylesheets_dir ||= paths["public/stylesheets"].first
|
data/lib/action_mailer.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2004-
|
4
|
+
# Copyright (c) 2004-2020 David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
@@ -67,4 +67,5 @@ autoload :Mime, "action_dispatch/http/mime_type"
|
|
67
67
|
ActiveSupport.on_load(:action_view) do
|
68
68
|
ActionView::Base.default_formats ||= Mime::SET.symbols
|
69
69
|
ActionView::Template::Types.delegate_to Mime
|
70
|
+
ActionView::LookupContext::DetailsKey.clear
|
70
71
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Description:
|
2
2
|
============
|
3
|
-
|
3
|
+
Generates a new mailer and its views. Passes the mailer name, either
|
4
4
|
CamelCased or under_scored, and an optional list of emails as arguments.
|
5
5
|
|
6
6
|
This generates a mailer class in app/mailers and invokes your template
|
@@ -8,10 +8,9 @@ Description:
|
|
8
8
|
|
9
9
|
Example:
|
10
10
|
========
|
11
|
-
rails generate mailer Notifications signup forgot_password invoice
|
11
|
+
bin/rails generate mailer Notifications signup forgot_password invoice
|
12
12
|
|
13
13
|
creates a Notifications mailer class, views, and test:
|
14
14
|
Mailer: app/mailers/notifications_mailer.rb
|
15
15
|
Views: app/views/notifications_mailer/signup.text.erb [...]
|
16
16
|
Test: test/mailers/notifications_mailer_test.rb
|
17
|
-
|
metadata
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.1.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 6.1.0.rc1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 6.1.0.rc1
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: actionpack
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - '='
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0.
|
33
|
+
version: 6.1.0.rc1
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - '='
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.0.
|
40
|
+
version: 6.1.0.rc1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: actionview
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - '='
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.0.
|
47
|
+
version: 6.1.0.rc1
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - '='
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.0.
|
54
|
+
version: 6.1.0.rc1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: activejob
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - '='
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 6.0.
|
61
|
+
version: 6.1.0.rc1
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - '='
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 6.0.
|
68
|
+
version: 6.1.0.rc1
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: mail
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,12 +137,11 @@ licenses:
|
|
123
137
|
- MIT
|
124
138
|
metadata:
|
125
139
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
126
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
127
|
-
documentation_uri: https://api.rubyonrails.org/v6.0.
|
140
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.0.rc1/actionmailer/CHANGELOG.md
|
141
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.0.rc1/
|
128
142
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
129
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.
|
130
|
-
|
131
|
-
post_install_message:
|
143
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc1/actionmailer
|
144
|
+
post_install_message:
|
132
145
|
rdoc_options: []
|
133
146
|
require_paths:
|
134
147
|
- lib
|
@@ -139,13 +152,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
152
|
version: 2.5.0
|
140
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
154
|
requirements:
|
142
|
-
- - "
|
155
|
+
- - ">"
|
143
156
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
157
|
+
version: 1.3.1
|
145
158
|
requirements:
|
146
159
|
- none
|
147
|
-
rubygems_version: 3.4
|
148
|
-
signing_key:
|
160
|
+
rubygems_version: 3.1.4
|
161
|
+
signing_key:
|
149
162
|
specification_version: 4
|
150
163
|
summary: Email composition and delivery framework (part of Rails).
|
151
164
|
test_files: []
|