actionmailer 6.1.4 → 7.0.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 +10 -45
- data/MIT-LICENSE +1 -1
- data/lib/action_mailer/base.rb +17 -8
- data/lib/action_mailer/gem_version.rb +4 -4
- data/lib/action_mailer/inline_preview_interceptor.rb +3 -3
- data/lib/action_mailer/message_delivery.rb +8 -38
- data/lib/action_mailer/parameterized.rb +4 -26
- data/lib/action_mailer/preview.rb +1 -1
- data/lib/action_mailer/railtie.rb +9 -0
- data/lib/action_mailer/rescuable.rb +3 -3
- data/lib/action_mailer/test_helper.rb +1 -2
- data/lib/action_mailer.rb +1 -2
- metadata +18 -18
- data/lib/action_mailer/delivery_job.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeaac20ea2d91009e6fb6e0e9f080316fe884071adc62627b3a5469699288535
|
4
|
+
data.tar.gz: b9db25aa1577ee0611ea79b8b4a6c1336a1102c4a0d6fd11ff4fe8ec8f38ecf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b30795e1a90f4de721aa9c1b1dbdfba9d7faa2b61b0623260d29be422f4b35f3fb7e3b074c79c35cadf5f6c4a666767462751326f76229e2cd9af2d5e6fc1e5
|
7
|
+
data.tar.gz: 6769fe17016fe9a091648514721b17d77daeb928cf20ff37af6e0a406de6c783159ac4567b3a3e4e3970bf673986b1df9e2d50a8aeeb335b21c92c70a68ab7e5
|
data/CHANGELOG.md
CHANGED
@@ -1,58 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
* No changes.
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 6.1.3.2 (May 05, 2021) ##
|
7
|
-
|
8
|
-
* No changes.
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 6.1.3.1 (March 26, 2021) ##
|
12
|
-
|
13
|
-
* No changes.
|
14
|
-
|
15
|
-
|
16
|
-
## Rails 6.1.3 (February 17, 2021) ##
|
17
|
-
|
18
|
-
* No changes.
|
1
|
+
* Remove deprecated `ActionMailer::DeliveryJob` and `ActionMailer::Parameterized::DeliveryJob`
|
2
|
+
in favor of `ActionMailer::MailDeliveryJob`.
|
19
3
|
|
4
|
+
*Rafael Mendonça França*
|
20
5
|
|
21
|
-
|
6
|
+
* `email_address_with_name` returns just the address if name is blank.
|
22
7
|
|
23
|
-
*
|
8
|
+
*Thomas Hutterer*
|
24
9
|
|
25
10
|
|
26
|
-
## Rails
|
11
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
27
12
|
|
28
13
|
* No changes.
|
29
14
|
|
30
15
|
|
31
|
-
## Rails
|
32
|
-
|
33
|
-
* Sets default mailer queue to `"default"` in the mail assertions.
|
34
|
-
|
35
|
-
*Paul Keen*
|
36
|
-
|
37
|
-
|
38
|
-
## Rails 6.1.0 (December 09, 2020) ##
|
39
|
-
|
40
|
-
* Change default queue name of the deliver (`:mailers`) job to be the job adapter's
|
41
|
-
default (`:default`).
|
42
|
-
|
43
|
-
*Rafael Mendonça França*
|
44
|
-
|
45
|
-
* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
|
46
|
-
|
47
|
-
*Rafael Mendonça França*
|
48
|
-
|
49
|
-
* Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.
|
50
|
-
|
51
|
-
*bogdanvlviv*
|
16
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
52
17
|
|
53
|
-
*
|
18
|
+
* Configures a default of 5 for both `open_timeout` and `read_timeout` for SMTP Settings.
|
54
19
|
|
55
|
-
*
|
20
|
+
*André Luis Leal Cardoso Junior*
|
56
21
|
|
57
22
|
|
58
|
-
Please check [6-
|
23
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailer/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
data/lib/action_mailer/base.rb
CHANGED
@@ -409,6 +409,8 @@ module ActionMailer
|
|
409
409
|
# of an OpenSSL verify constant (<tt>'none'</tt> or <tt>'peer'</tt>) or directly the constant
|
410
410
|
# (<tt>OpenSSL::SSL::VERIFY_NONE</tt> or <tt>OpenSSL::SSL::VERIFY_PEER</tt>).
|
411
411
|
# * <tt>:ssl/:tls</tt> Enables the SMTP connection to use SMTP/TLS (SMTPS: SMTP over direct TLS connection)
|
412
|
+
# * <tt>:open_timeout</tt> Number of seconds to wait while attempting to open a connection.
|
413
|
+
# * <tt>:read_timeout</tt> Number of seconds to wait until timing-out a read(2) call.
|
412
414
|
#
|
413
415
|
# * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
|
414
416
|
# * <tt>:location</tt> - The location of the sendmail executable. Defaults to <tt>/usr/sbin/sendmail</tt>.
|
@@ -433,7 +435,10 @@ module ActionMailer
|
|
433
435
|
# * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with
|
434
436
|
# <tt>delivery_method :test</tt>. Most useful for unit and functional testing.
|
435
437
|
#
|
436
|
-
# * <tt>
|
438
|
+
# * <tt>delivery_job</tt> - The job class used with <tt>deliver_later</tt>. Defaults to
|
439
|
+
# +ActionMailer::MailDeliveryJob+.
|
440
|
+
#
|
441
|
+
# * <tt>deliver_later_queue_name</tt> - The name of the queue used with <tt>deliver_later</tt>.
|
437
442
|
class Base < AbstractController::Base
|
438
443
|
include DeliveryMethods
|
439
444
|
include Rescuable
|
@@ -457,7 +462,7 @@ module ActionMailer
|
|
457
462
|
|
458
463
|
helper ActionMailer::MailHelper
|
459
464
|
|
460
|
-
class_attribute :delivery_job, default: ::ActionMailer::
|
465
|
+
class_attribute :delivery_job, default: ::ActionMailer::MailDeliveryJob
|
461
466
|
class_attribute :default_params, default: {
|
462
467
|
mime_version: "1.0",
|
463
468
|
charset: "UTF-8",
|
@@ -553,7 +558,7 @@ module ActionMailer
|
|
553
558
|
# through a callback when you call <tt>:deliver</tt> on the <tt>Mail::Message</tt>,
|
554
559
|
# calling +deliver_mail+ directly and passing a <tt>Mail::Message</tt> will do
|
555
560
|
# nothing except tell the logger you sent the email.
|
556
|
-
def deliver_mail(mail)
|
561
|
+
def deliver_mail(mail) # :nodoc:
|
557
562
|
ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
|
558
563
|
set_payload_for_mail(payload, mail)
|
559
564
|
yield # Let Mail do the delivery actions
|
@@ -561,10 +566,12 @@ module ActionMailer
|
|
561
566
|
end
|
562
567
|
|
563
568
|
# Returns an email in the format "Name <email@example.com>".
|
569
|
+
#
|
570
|
+
# If the name is a blank string, it returns just the address.
|
564
571
|
def email_address_with_name(address, name)
|
565
572
|
Mail::Address.new.tap do |builder|
|
566
573
|
builder.address = address
|
567
|
-
builder.display_name = name
|
574
|
+
builder.display_name = name.presence
|
568
575
|
end.to_s
|
569
576
|
end
|
570
577
|
|
@@ -589,7 +596,7 @@ module ActionMailer
|
|
589
596
|
super
|
590
597
|
end
|
591
598
|
end
|
592
|
-
ruby2_keywords(:method_missing)
|
599
|
+
ruby2_keywords(:method_missing)
|
593
600
|
|
594
601
|
def respond_to_missing?(method, include_all = false)
|
595
602
|
action_methods.include?(method.to_s) || super
|
@@ -604,7 +611,7 @@ module ActionMailer
|
|
604
611
|
@_message = Mail.new
|
605
612
|
end
|
606
613
|
|
607
|
-
def process(method_name, *args)
|
614
|
+
def process(method_name, *args) # :nodoc:
|
608
615
|
payload = {
|
609
616
|
mailer: self.class.name,
|
610
617
|
action: method_name,
|
@@ -617,7 +624,7 @@ module ActionMailer
|
|
617
624
|
end
|
618
625
|
end
|
619
626
|
|
620
|
-
class NullMail
|
627
|
+
class NullMail # :nodoc:
|
621
628
|
def body; "" end
|
622
629
|
def header; {} end
|
623
630
|
|
@@ -636,6 +643,8 @@ module ActionMailer
|
|
636
643
|
end
|
637
644
|
|
638
645
|
# Returns an email in the format "Name <email@example.com>".
|
646
|
+
#
|
647
|
+
# If the name is a blank string, it returns just the address.
|
639
648
|
def email_address_with_name(address, name)
|
640
649
|
self.class.email_address_with_name(address, name)
|
641
650
|
end
|
@@ -899,7 +908,7 @@ module ActionMailer
|
|
899
908
|
end
|
900
909
|
|
901
910
|
def apply_defaults(headers)
|
902
|
-
default_values = self.class.default.transform_values do |value|
|
911
|
+
default_values = self.class.default.except(*headers.keys).transform_values do |value|
|
903
912
|
compute_default(value)
|
904
913
|
end
|
905
914
|
|
@@ -17,15 +17,15 @@ module ActionMailer
|
|
17
17
|
|
18
18
|
include Base64
|
19
19
|
|
20
|
-
def self.previewing_email(message)
|
20
|
+
def self.previewing_email(message) # :nodoc:
|
21
21
|
new(message).transform!
|
22
22
|
end
|
23
23
|
|
24
|
-
def initialize(message)
|
24
|
+
def initialize(message) # :nodoc:
|
25
25
|
@message = message
|
26
26
|
end
|
27
27
|
|
28
|
-
def transform!
|
28
|
+
def transform! # :nodoc:
|
29
29
|
return message if html_part.blank?
|
30
30
|
|
31
31
|
html_part.body = html_part.decoded.gsub(PATTERN) do |match|
|
@@ -15,7 +15,7 @@ module ActionMailer
|
|
15
15
|
# Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job
|
16
16
|
# Notifier.welcome(User.first).message # a Mail::Message object
|
17
17
|
class MessageDelivery < Delegator
|
18
|
-
def initialize(mailer_class, action, *args)
|
18
|
+
def initialize(mailer_class, action, *args) # :nodoc:
|
19
19
|
@mailer_class, @action, @args = mailer_class, action, args
|
20
20
|
|
21
21
|
# The mail is only processed if we try to call any methods on it.
|
@@ -23,15 +23,15 @@ module ActionMailer
|
|
23
23
|
@processed_mailer = nil
|
24
24
|
@mail_message = nil
|
25
25
|
end
|
26
|
-
ruby2_keywords(:initialize)
|
26
|
+
ruby2_keywords(:initialize)
|
27
27
|
|
28
28
|
# Method calls are delegated to the Mail::Message that's ready to deliver.
|
29
|
-
def __getobj__
|
29
|
+
def __getobj__ # :nodoc:
|
30
30
|
@mail_message ||= processed_mailer.message
|
31
31
|
end
|
32
32
|
|
33
33
|
# Unused except for delegator internals (dup, marshalling).
|
34
|
-
def __setobj__(mail_message)
|
34
|
+
def __setobj__(mail_message) # :nodoc:
|
35
35
|
@mail_message = mail_message
|
36
36
|
end
|
37
37
|
|
@@ -62,7 +62,7 @@ module ActionMailer
|
|
62
62
|
# * <tt>:queue</tt> - Enqueue the email on the specified queue
|
63
63
|
# * <tt>:priority</tt> - Enqueues the email with the specified priority
|
64
64
|
#
|
65
|
-
# By default, the email will be enqueued using <tt>ActionMailer::
|
65
|
+
# By default, the email will be enqueued using <tt>ActionMailer::MailDeliveryJob</tt>. Each
|
66
66
|
# <tt>ActionMailer::Base</tt> class can specify the job to use by setting the class variable
|
67
67
|
# +delivery_job+.
|
68
68
|
#
|
@@ -88,7 +88,7 @@ module ActionMailer
|
|
88
88
|
# * <tt>:queue</tt> - Enqueue the email on the specified queue.
|
89
89
|
# * <tt>:priority</tt> - Enqueues the email with the specified priority
|
90
90
|
#
|
91
|
-
# By default, the email will be enqueued using <tt>ActionMailer::
|
91
|
+
# By default, the email will be enqueued using <tt>ActionMailer::MailDeliveryJob</tt>. Each
|
92
92
|
# <tt>ActionMailer::Base</tt> class can specify the job to use by setting the class variable
|
93
93
|
# +delivery_job+.
|
94
94
|
#
|
@@ -140,38 +140,8 @@ module ActionMailer
|
|
140
140
|
"#deliver_later, 2. only touch the message *within your mailer " \
|
141
141
|
"method*, or 3. use a custom Active Job instead of #deliver_later."
|
142
142
|
else
|
143
|
-
|
144
|
-
|
145
|
-
if use_new_args?(job)
|
146
|
-
job.set(options).perform_later(
|
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)
|
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
|
-
|
162
|
-
job.set(options).perform_later(
|
163
|
-
@mailer_class.name, @action.to_s, delivery_method.to_s, *@args)
|
164
|
-
end
|
165
|
-
end
|
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
|
143
|
+
@mailer_class.delivery_job.set(options).perform_later(
|
144
|
+
@mailer_class.name, @action.to_s, delivery_method.to_s, args: @args)
|
175
145
|
end
|
176
146
|
end
|
177
147
|
end
|
@@ -115,26 +115,19 @@ module ActionMailer
|
|
115
115
|
super
|
116
116
|
end
|
117
117
|
end
|
118
|
-
ruby2_keywords(:method_missing)
|
118
|
+
ruby2_keywords(:method_missing)
|
119
119
|
|
120
120
|
def respond_to_missing?(method, include_all = false)
|
121
121
|
@mailer.respond_to?(method, include_all)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
-
class DeliveryJob < ActionMailer::DeliveryJob # :nodoc:
|
126
|
-
def perform(mailer, mail_method, delivery_method, params, *args)
|
127
|
-
mailer.constantize.with(params).public_send(mail_method, *args).send(delivery_method)
|
128
|
-
end
|
129
|
-
ruby2_keywords(:perform) if respond_to?(:ruby2_keywords, true)
|
130
|
-
end
|
131
|
-
|
132
125
|
class MessageDelivery < ActionMailer::MessageDelivery # :nodoc:
|
133
126
|
def initialize(mailer_class, action, params, *args)
|
134
127
|
super(mailer_class, action, *args)
|
135
128
|
@params = params
|
136
129
|
end
|
137
|
-
ruby2_keywords(:initialize)
|
130
|
+
ruby2_keywords(:initialize)
|
138
131
|
|
139
132
|
private
|
140
133
|
def processed_mailer
|
@@ -148,23 +141,8 @@ module ActionMailer
|
|
148
141
|
if processed?
|
149
142
|
super
|
150
143
|
else
|
151
|
-
|
152
|
-
|
153
|
-
if job <= MailDeliveryJob
|
154
|
-
job.set(options).perform_later(
|
155
|
-
@mailer_class.name, @action.to_s, delivery_method.to_s, params: @params, args: @args)
|
156
|
-
else
|
157
|
-
job.set(options).perform_later(
|
158
|
-
@mailer_class.name, @action.to_s, delivery_method.to_s, @params, *@args)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
def delivery_job_class
|
164
|
-
if @mailer_class.delivery_job <= MailDeliveryJob
|
165
|
-
@mailer_class.delivery_job
|
166
|
-
else
|
167
|
-
Parameterized::DeliveryJob
|
144
|
+
@mailer_class.delivery_job.set(options).perform_later(
|
145
|
+
@mailer_class.name, @action.to_s, delivery_method.to_s, params: @params, args: @args)
|
168
146
|
end
|
169
147
|
end
|
170
148
|
end
|
@@ -45,6 +45,15 @@ module ActionMailer
|
|
45
45
|
self.delivery_job = delivery_job.constantize
|
46
46
|
end
|
47
47
|
|
48
|
+
if smtp_settings = options.delete(:smtp_settings)
|
49
|
+
self.smtp_settings = smtp_settings
|
50
|
+
end
|
51
|
+
|
52
|
+
if smtp_timeout = options.delete(:smtp_timeout)
|
53
|
+
self.smtp_settings[:open_timeout] ||= smtp_timeout
|
54
|
+
self.smtp_settings[:read_timeout] ||= smtp_timeout
|
55
|
+
end
|
56
|
+
|
48
57
|
options.each { |k, v| send("#{k}=", v) }
|
49
58
|
end
|
50
59
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module ActionMailer
|
3
|
+
module ActionMailer # :nodoc:
|
4
4
|
# Provides +rescue_from+ for mailers. Wraps mailer action processing,
|
5
5
|
# mail job processing, and mail delivery.
|
6
6
|
module Rescuable
|
@@ -8,12 +8,12 @@ module ActionMailer #:nodoc:
|
|
8
8
|
include ActiveSupport::Rescuable
|
9
9
|
|
10
10
|
class_methods do
|
11
|
-
def handle_exception(exception)
|
11
|
+
def handle_exception(exception) # :nodoc:
|
12
12
|
rescue_with_handler(exception) || raise(exception)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def handle_exceptions
|
16
|
+
def handle_exceptions # :nodoc:
|
17
17
|
yield
|
18
18
|
rescue => exception
|
19
19
|
rescue_with_handler(exception) || raise
|
@@ -155,8 +155,7 @@ module ActionMailer
|
|
155
155
|
def delivery_job_filter(job)
|
156
156
|
job_class = job.is_a?(Hash) ? job.fetch(:job) : job.class
|
157
157
|
|
158
|
-
Base.descendants.map(&:delivery_job).include?(job_class)
|
159
|
-
ActionMailer::Parameterized::DeliveryJob == job_class
|
158
|
+
Base.descendants.map(&:delivery_job).include?(job_class)
|
160
159
|
end
|
161
160
|
end
|
162
161
|
end
|
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-2021 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
|
@@ -51,7 +51,6 @@ module ActionMailer
|
|
51
51
|
autoload :TestCase
|
52
52
|
autoload :TestHelper
|
53
53
|
autoload :MessageDelivery
|
54
|
-
autoload :DeliveryJob
|
55
54
|
autoload :MailDeliveryJob
|
56
55
|
|
57
56
|
def self.eager_load!
|
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
|
+
version: 7.0.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: 2021-06
|
11
|
+
date: 2021-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.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:
|
26
|
+
version: 7.0.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 7.0.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:
|
40
|
+
version: 7.0.0.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: actionview
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 7.0.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:
|
54
|
+
version: 7.0.0.rc1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activejob
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 7.0.0.rc1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 7.0.0.rc1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mail
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,7 +113,6 @@ files:
|
|
113
113
|
- lib/action_mailer.rb
|
114
114
|
- lib/action_mailer/base.rb
|
115
115
|
- lib/action_mailer/collector.rb
|
116
|
-
- lib/action_mailer/delivery_job.rb
|
117
116
|
- lib/action_mailer/delivery_methods.rb
|
118
117
|
- lib/action_mailer/gem_version.rb
|
119
118
|
- lib/action_mailer/inline_preview_interceptor.rb
|
@@ -137,10 +136,11 @@ licenses:
|
|
137
136
|
- MIT
|
138
137
|
metadata:
|
139
138
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
140
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
141
|
-
documentation_uri: https://api.rubyonrails.org/
|
139
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.0.rc1/actionmailer/CHANGELOG.md
|
140
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.0.rc1/
|
142
141
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
143
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
142
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.0.rc1/actionmailer
|
143
|
+
rubygems_mfa_required: 'true'
|
144
144
|
post_install_message:
|
145
145
|
rdoc_options: []
|
146
146
|
require_paths:
|
@@ -149,15 +149,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 2.
|
152
|
+
version: 2.7.0
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- - "
|
155
|
+
- - ">"
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
157
|
+
version: 1.3.1
|
158
158
|
requirements:
|
159
159
|
- none
|
160
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.2.22
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Email composition and delivery framework (part of Rails).
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "active_job"
|
4
|
-
|
5
|
-
module ActionMailer
|
6
|
-
# The <tt>ActionMailer::DeliveryJob</tt> class is used when you
|
7
|
-
# want to send emails outside of the request-response cycle.
|
8
|
-
#
|
9
|
-
# Exceptions are rescued and handled by the mailer class.
|
10
|
-
class DeliveryJob < ActiveJob::Base # :nodoc:
|
11
|
-
queue_as { ActionMailer::Base.deliver_later_queue_name }
|
12
|
-
|
13
|
-
rescue_from StandardError, with: :handle_exception_with_mailer_class
|
14
|
-
|
15
|
-
before_perform do
|
16
|
-
ActiveSupport::Deprecation.warn <<~MSG.squish
|
17
|
-
Sending mail with DeliveryJob and Parameterized::DeliveryJob
|
18
|
-
is deprecated and will be removed in Rails 6.2.
|
19
|
-
Please use MailDeliveryJob instead.
|
20
|
-
MSG
|
21
|
-
end
|
22
|
-
|
23
|
-
def perform(mailer, mail_method, delivery_method, *args) #:nodoc:
|
24
|
-
mailer.constantize.public_send(mail_method, *args).send(delivery_method)
|
25
|
-
end
|
26
|
-
ruby2_keywords(:perform) if respond_to?(:ruby2_keywords, true)
|
27
|
-
|
28
|
-
private
|
29
|
-
# "Deserialize" the mailer class name by hand in case another argument
|
30
|
-
# (like a Global ID reference) raised DeserializationError.
|
31
|
-
def mailer_class
|
32
|
-
if mailer = Array(@serialized_arguments).first || Array(arguments).first
|
33
|
-
mailer.constantize
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def handle_exception_with_mailer_class(exception)
|
38
|
-
if klass = mailer_class
|
39
|
-
klass.handle_exception exception
|
40
|
-
else
|
41
|
-
raise exception
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|