actionmailer 6.1.7.8 → 7.0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +54 -42
- data/MIT-LICENSE +1 -0
- data/README.rdoc +2 -2
- data/lib/action_mailer/base.rb +54 -20
- data/lib/action_mailer/gem_version.rb +5 -5
- data/lib/action_mailer/inline_preview_interceptor.rb +3 -3
- data/lib/action_mailer/mail_helper.rb +11 -3
- data/lib/action_mailer/message_delivery.rb +10 -40
- data/lib/action_mailer/parameterized.rb +4 -26
- data/lib/action_mailer/preview.rb +1 -1
- data/lib/action_mailer/railtie.rb +11 -0
- data/lib/action_mailer/rescuable.rb +8 -6
- data/lib/action_mailer/test_helper.rb +1 -2
- data/lib/action_mailer/version.rb +1 -1
- data/lib/action_mailer.rb +1 -2
- metadata +60 -20
- data/lib/action_mailer/delivery_job.rb +0 -45
- data/lib/action_mailer/mail_with_error_handling.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f4d9c6fa5752fbe62db63c8de99ad3355f0c93160c07b459f44216129c5d2ca
|
4
|
+
data.tar.gz: f275a1e86c5ab3ba596624fd6eb415fb2023f5cb6b5af9b86dffc78df144a427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1012558b72b2e36dbaf4ea82105ed6a07b9547cdcbdc0249070dcf66963794b9ca1fea7301a5335cffc407ef8a95ca54728e5d0a97f836a11776ee6d5892300a
|
7
|
+
data.tar.gz: 38035f47626115c90371aa314ba587f8940c8ae0cd0b79748d10705991f66a4c2eaab3e47551bb4e281592e8bb907f70b0d8dbfd69672e8c2300b4ee002b6237
|
data/CHANGELOG.md
CHANGED
@@ -1,158 +1,170 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.8.6 (October 23, 2024) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Fix NoMethodError in `block_format` helper
|
4
4
|
|
5
|
+
*Michael Leimstaedtner*
|
5
6
|
|
6
|
-
## Rails 6.1.7.7 (February 21, 2024) ##
|
7
7
|
|
8
|
-
|
8
|
+
## Rails 7.0.8.5 (October 15, 2024) ##
|
9
|
+
|
10
|
+
* Avoid regex backtracking in `block_format` helper
|
11
|
+
|
12
|
+
[CVE-2024-47889]
|
9
13
|
|
10
14
|
|
11
|
-
## Rails
|
15
|
+
## Rails 7.0.8.4 (June 04, 2024) ##
|
12
16
|
|
13
17
|
* No changes.
|
14
18
|
|
15
19
|
|
16
|
-
## Rails
|
20
|
+
## Rails 7.0.8.3 (May 17, 2024) ##
|
17
21
|
|
18
22
|
* No changes.
|
19
23
|
|
20
24
|
|
21
|
-
## Rails
|
25
|
+
## Rails 7.0.8.2 (May 16, 2024) ##
|
22
26
|
|
23
27
|
* No changes.
|
24
28
|
|
25
29
|
|
26
|
-
## Rails
|
30
|
+
## Rails 7.0.8.1 (February 21, 2024) ##
|
27
31
|
|
28
32
|
* No changes.
|
29
33
|
|
30
34
|
|
31
|
-
## Rails
|
35
|
+
## Rails 7.0.8 (September 09, 2023) ##
|
32
36
|
|
33
37
|
* No changes.
|
34
38
|
|
35
39
|
|
36
|
-
## Rails
|
40
|
+
## Rails 7.0.7.2 (August 22, 2023) ##
|
37
41
|
|
38
42
|
* No changes.
|
39
43
|
|
40
44
|
|
41
|
-
## Rails
|
45
|
+
## Rails 7.0.7.1 (August 22, 2023) ##
|
42
46
|
|
43
47
|
* No changes.
|
44
48
|
|
45
49
|
|
46
|
-
## Rails
|
50
|
+
## Rails 7.0.7 (August 09, 2023) ##
|
47
51
|
|
48
52
|
* No changes.
|
49
53
|
|
50
54
|
|
51
|
-
## Rails
|
55
|
+
## Rails 7.0.6 (June 29, 2023) ##
|
52
56
|
|
53
57
|
* No changes.
|
54
58
|
|
55
59
|
|
56
|
-
## Rails
|
60
|
+
## Rails 7.0.5.1 (June 26, 2023) ##
|
57
61
|
|
58
62
|
* No changes.
|
59
63
|
|
60
64
|
|
61
|
-
## Rails
|
65
|
+
## Rails 7.0.5 (May 24, 2023) ##
|
62
66
|
|
63
67
|
* No changes.
|
64
68
|
|
65
69
|
|
66
|
-
## Rails
|
70
|
+
## Rails 7.0.4.3 (March 13, 2023) ##
|
67
71
|
|
68
72
|
* No changes.
|
69
73
|
|
70
74
|
|
71
|
-
## Rails
|
75
|
+
## Rails 7.0.4.2 (January 24, 2023) ##
|
72
76
|
|
73
77
|
* No changes.
|
74
78
|
|
75
79
|
|
76
|
-
## Rails
|
80
|
+
## Rails 7.0.4.1 (January 17, 2023) ##
|
77
81
|
|
78
82
|
* No changes.
|
79
83
|
|
80
84
|
|
81
|
-
## Rails
|
85
|
+
## Rails 7.0.4 (September 09, 2022) ##
|
82
86
|
|
83
87
|
* No changes.
|
84
88
|
|
85
89
|
|
86
|
-
## Rails
|
90
|
+
## Rails 7.0.3.1 (July 12, 2022) ##
|
87
91
|
|
88
92
|
* No changes.
|
89
93
|
|
90
94
|
|
91
|
-
## Rails
|
95
|
+
## Rails 7.0.3 (May 09, 2022) ##
|
92
96
|
|
93
97
|
* No changes.
|
94
98
|
|
95
99
|
|
96
|
-
## Rails
|
100
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
97
101
|
|
98
102
|
* No changes.
|
99
103
|
|
100
104
|
|
101
|
-
## Rails
|
105
|
+
## Rails 7.0.2.3 (March 08, 2022) ##
|
102
106
|
|
103
107
|
* No changes.
|
104
108
|
|
105
109
|
|
106
|
-
## Rails
|
110
|
+
## Rails 7.0.2.2 (February 11, 2022) ##
|
107
111
|
|
108
112
|
* No changes.
|
109
113
|
|
110
114
|
|
111
|
-
## Rails
|
115
|
+
## Rails 7.0.2.1 (February 11, 2022) ##
|
112
116
|
|
113
117
|
* No changes.
|
114
118
|
|
115
119
|
|
116
|
-
## Rails
|
120
|
+
## Rails 7.0.2 (February 08, 2022) ##
|
117
121
|
|
118
122
|
* No changes.
|
119
123
|
|
120
124
|
|
121
|
-
## Rails
|
125
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
122
126
|
|
123
|
-
*
|
127
|
+
* Keep configuration of `smtp_settings` consistent between 6.1 and 7.0.
|
128
|
+
|
129
|
+
*André Luis Leal Cardoso Junior*
|
124
130
|
|
125
131
|
|
126
|
-
## Rails
|
132
|
+
## Rails 7.0.0 (December 15, 2021) ##
|
127
133
|
|
128
134
|
* No changes.
|
129
135
|
|
130
136
|
|
131
|
-
## Rails
|
137
|
+
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
138
|
+
|
139
|
+
* No changes.
|
132
140
|
|
133
|
-
* Sets default mailer queue to `"default"` in the mail assertions.
|
134
141
|
|
135
|
-
|
142
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
136
143
|
|
144
|
+
* No changes.
|
137
145
|
|
138
|
-
## Rails
|
146
|
+
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
139
147
|
|
140
|
-
*
|
141
|
-
|
148
|
+
* Remove deprecated `ActionMailer::DeliveryJob` and `ActionMailer::Parameterized::DeliveryJob`
|
149
|
+
in favor of `ActionMailer::MailDeliveryJob`.
|
142
150
|
|
143
151
|
*Rafael Mendonça França*
|
144
152
|
|
145
|
-
*
|
153
|
+
* `email_address_with_name` returns just the address if name is blank.
|
146
154
|
|
147
|
-
*
|
155
|
+
*Thomas Hutterer*
|
156
|
+
|
157
|
+
|
158
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
159
|
+
|
160
|
+
* No changes.
|
148
161
|
|
149
|
-
* Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job.
|
150
162
|
|
151
|
-
|
163
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
152
164
|
|
153
|
-
*
|
165
|
+
* Configures a default of 5 for both `open_timeout` and `read_timeout` for SMTP Settings.
|
154
166
|
|
155
|
-
*
|
167
|
+
*André Luis Leal Cardoso Junior*
|
156
168
|
|
157
169
|
|
158
|
-
Please check [6-
|
170
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionmailer/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
@@ -18,3 +18,4 @@ 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
@@ -114,7 +114,7 @@ The latest version of Action Mailer can be installed with RubyGems:
|
|
114
114
|
|
115
115
|
$ gem install actionmailer
|
116
116
|
|
117
|
-
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:
|
118
118
|
|
119
119
|
* https://github.com/rails/rails/tree/main/actionmailer
|
120
120
|
|
@@ -132,7 +132,7 @@ API documentation is at
|
|
132
132
|
|
133
133
|
* https://api.rubyonrails.org
|
134
134
|
|
135
|
-
Bug reports for the Ruby on Rails project can be filed here:
|
135
|
+
Bug reports for the Ruby on \Rails project can be filed here:
|
136
136
|
|
137
137
|
* https://github.com/rails/rails/issues
|
138
138
|
|
data/lib/action_mailer/base.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "mail"
|
4
4
|
require "action_mailer/collector"
|
5
5
|
require "active_support/core_ext/string/inflections"
|
6
6
|
require "active_support/core_ext/hash/except"
|
@@ -106,7 +106,7 @@ module ActionMailer
|
|
106
106
|
# You got a new note!
|
107
107
|
# <%= truncate(@note.body, length: 25) %>
|
108
108
|
#
|
109
|
-
# If you need to access the subject, from or the recipients in the view, you can do that through message object:
|
109
|
+
# If you need to access the subject, from, or the recipients in the view, you can do that through message object:
|
110
110
|
#
|
111
111
|
# You got a new note from <%= message.from %>!
|
112
112
|
# <%= truncate(@note.body, length: 25) %>
|
@@ -149,9 +149,9 @@ module ActionMailer
|
|
149
149
|
# mail = NotifierMailer.welcome(User.first) # => an ActionMailer::MessageDelivery object
|
150
150
|
# mail.deliver_now # generates and sends the email now
|
151
151
|
#
|
152
|
-
# The
|
152
|
+
# The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call
|
153
153
|
# your method to generate the mail. If you want direct access to the delegator, or <tt>Mail::Message</tt>,
|
154
|
-
# you can call the <tt>message</tt> method on the
|
154
|
+
# you can call the <tt>message</tt> method on the ActionMailer::MessageDelivery object.
|
155
155
|
#
|
156
156
|
# NotifierMailer.welcome(User.first).message # => a Mail::Message object
|
157
157
|
#
|
@@ -334,14 +334,37 @@ module ActionMailer
|
|
334
334
|
# end
|
335
335
|
#
|
336
336
|
# Callbacks in Action Mailer are implemented using
|
337
|
-
#
|
337
|
+
# AbstractController::Callbacks, so you can define and configure
|
338
338
|
# callbacks in the same manner that you would use callbacks in classes that
|
339
|
-
# inherit from
|
339
|
+
# inherit from ActionController::Base.
|
340
340
|
#
|
341
341
|
# Note that unless you have a specific reason to do so, you should prefer
|
342
342
|
# using <tt>before_action</tt> rather than <tt>after_action</tt> in your
|
343
343
|
# Action Mailer classes so that headers are parsed properly.
|
344
344
|
#
|
345
|
+
# = Rescuing Errors
|
346
|
+
#
|
347
|
+
# +rescue+ blocks inside of a mailer method cannot rescue errors that occur
|
348
|
+
# outside of rendering -- for example, record deserialization errors in a
|
349
|
+
# background job, or errors from a third-party mail delivery service.
|
350
|
+
#
|
351
|
+
# To rescue errors that occur during any part of the mailing process, use
|
352
|
+
# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]:
|
353
|
+
#
|
354
|
+
# class NotifierMailer < ApplicationMailer
|
355
|
+
# rescue_from ActiveJob::DeserializationError do
|
356
|
+
# # ...
|
357
|
+
# end
|
358
|
+
#
|
359
|
+
# rescue_from "SomeThirdPartyService::ApiError" do
|
360
|
+
# # ...
|
361
|
+
# end
|
362
|
+
#
|
363
|
+
# def notify(recipient)
|
364
|
+
# mail(to: recipient, subject: "Notification")
|
365
|
+
# end
|
366
|
+
# end
|
367
|
+
#
|
345
368
|
# = Previewing emails
|
346
369
|
#
|
347
370
|
# You can preview your email templates visually by adding a mailer preview file to the
|
@@ -402,6 +425,7 @@ module ActionMailer
|
|
402
425
|
# This is a symbol and one of <tt>:plain</tt> (will send the password Base64 encoded), <tt>:login</tt> (will
|
403
426
|
# send the password Base64 encoded) or <tt>:cram_md5</tt> (combines a Challenge/Response mechanism to exchange
|
404
427
|
# information and a cryptographic Message Digest 5 algorithm to hash important information)
|
428
|
+
# * <tt>:enable_starttls</tt> - Use STARTTLS when connecting to your SMTP server and fail if unsupported. Defaults to <tt>false</tt>.
|
405
429
|
# * <tt>:enable_starttls_auto</tt> - Detects if STARTTLS is enabled in your SMTP server and starts
|
406
430
|
# to use it. Defaults to <tt>true</tt>.
|
407
431
|
# * <tt>:openssl_verify_mode</tt> - When using TLS, you can set how OpenSSL checks the certificate. This is
|
@@ -409,6 +433,8 @@ module ActionMailer
|
|
409
433
|
# of an OpenSSL verify constant (<tt>'none'</tt> or <tt>'peer'</tt>) or directly the constant
|
410
434
|
# (<tt>OpenSSL::SSL::VERIFY_NONE</tt> or <tt>OpenSSL::SSL::VERIFY_PEER</tt>).
|
411
435
|
# * <tt>:ssl/:tls</tt> Enables the SMTP connection to use SMTP/TLS (SMTPS: SMTP over direct TLS connection)
|
436
|
+
# * <tt>:open_timeout</tt> Number of seconds to wait while attempting to open a connection.
|
437
|
+
# * <tt>:read_timeout</tt> Number of seconds to wait until timing-out a read(2) call.
|
412
438
|
#
|
413
439
|
# * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
|
414
440
|
# * <tt>:location</tt> - The location of the sendmail executable. Defaults to <tt>/usr/sbin/sendmail</tt>.
|
@@ -433,7 +459,10 @@ module ActionMailer
|
|
433
459
|
# * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with
|
434
460
|
# <tt>delivery_method :test</tt>. Most useful for unit and functional testing.
|
435
461
|
#
|
436
|
-
# * <tt>
|
462
|
+
# * <tt>delivery_job</tt> - The job class used with <tt>deliver_later</tt>. Defaults to
|
463
|
+
# +ActionMailer::MailDeliveryJob+.
|
464
|
+
#
|
465
|
+
# * <tt>deliver_later_queue_name</tt> - The name of the queue used with <tt>deliver_later</tt>.
|
437
466
|
class Base < AbstractController::Base
|
438
467
|
include DeliveryMethods
|
439
468
|
include Rescuable
|
@@ -457,7 +486,7 @@ module ActionMailer
|
|
457
486
|
|
458
487
|
helper ActionMailer::MailHelper
|
459
488
|
|
460
|
-
class_attribute :delivery_job, default: ::ActionMailer::
|
489
|
+
class_attribute :delivery_job, default: ::ActionMailer::MailDeliveryJob
|
461
490
|
class_attribute :default_params, default: {
|
462
491
|
mime_version: "1.0",
|
463
492
|
charset: "UTF-8",
|
@@ -487,28 +516,28 @@ module ActionMailer
|
|
487
516
|
end
|
488
517
|
|
489
518
|
# Register an Observer which will be notified when mail is delivered.
|
490
|
-
# Either a class, string or symbol can be passed in as the Observer.
|
519
|
+
# Either a class, string, or symbol can be passed in as the Observer.
|
491
520
|
# If a string or symbol is passed in it will be camelized and constantized.
|
492
521
|
def register_observer(observer)
|
493
522
|
Mail.register_observer(observer_class_for(observer))
|
494
523
|
end
|
495
524
|
|
496
525
|
# Unregister a previously registered Observer.
|
497
|
-
# Either a class, string or symbol can be passed in as the Observer.
|
526
|
+
# Either a class, string, or symbol can be passed in as the Observer.
|
498
527
|
# If a string or symbol is passed in it will be camelized and constantized.
|
499
528
|
def unregister_observer(observer)
|
500
529
|
Mail.unregister_observer(observer_class_for(observer))
|
501
530
|
end
|
502
531
|
|
503
532
|
# Register an Interceptor which will be called before mail is sent.
|
504
|
-
# Either a class, string or symbol can be passed in as the Interceptor.
|
533
|
+
# Either a class, string, or symbol can be passed in as the Interceptor.
|
505
534
|
# If a string or symbol is passed in it will be camelized and constantized.
|
506
535
|
def register_interceptor(interceptor)
|
507
536
|
Mail.register_interceptor(observer_class_for(interceptor))
|
508
537
|
end
|
509
538
|
|
510
539
|
# Unregister a previously registered Interceptor.
|
511
|
-
# Either a class, string or symbol can be passed in as the Interceptor.
|
540
|
+
# Either a class, string, or symbol can be passed in as the Interceptor.
|
512
541
|
# If a string or symbol is passed in it will be camelized and constantized.
|
513
542
|
def unregister_interceptor(interceptor)
|
514
543
|
Mail.unregister_interceptor(observer_class_for(interceptor))
|
@@ -553,7 +582,7 @@ module ActionMailer
|
|
553
582
|
# through a callback when you call <tt>:deliver</tt> on the <tt>Mail::Message</tt>,
|
554
583
|
# calling +deliver_mail+ directly and passing a <tt>Mail::Message</tt> will do
|
555
584
|
# nothing except tell the logger you sent the email.
|
556
|
-
def deliver_mail(mail)
|
585
|
+
def deliver_mail(mail) # :nodoc:
|
557
586
|
ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
|
558
587
|
set_payload_for_mail(payload, mail)
|
559
588
|
yield # Let Mail do the delivery actions
|
@@ -561,10 +590,12 @@ module ActionMailer
|
|
561
590
|
end
|
562
591
|
|
563
592
|
# Returns an email in the format "Name <email@example.com>".
|
593
|
+
#
|
594
|
+
# If the name is a blank string, it returns just the address.
|
564
595
|
def email_address_with_name(address, name)
|
565
596
|
Mail::Address.new.tap do |builder|
|
566
597
|
builder.address = address
|
567
|
-
builder.display_name = name
|
598
|
+
builder.display_name = name.presence
|
568
599
|
end.to_s
|
569
600
|
end
|
570
601
|
|
@@ -589,7 +620,7 @@ module ActionMailer
|
|
589
620
|
super
|
590
621
|
end
|
591
622
|
end
|
592
|
-
ruby2_keywords(:method_missing)
|
623
|
+
ruby2_keywords(:method_missing)
|
593
624
|
|
594
625
|
def respond_to_missing?(method, include_all = false)
|
595
626
|
action_methods.include?(method.to_s) || super
|
@@ -604,7 +635,7 @@ module ActionMailer
|
|
604
635
|
@_message = Mail.new
|
605
636
|
end
|
606
637
|
|
607
|
-
def process(method_name, *args)
|
638
|
+
def process(method_name, *args) # :nodoc:
|
608
639
|
payload = {
|
609
640
|
mailer: self.class.name,
|
610
641
|
action: method_name,
|
@@ -616,8 +647,9 @@ module ActionMailer
|
|
616
647
|
@_message = NullMail.new unless @_mail_was_called
|
617
648
|
end
|
618
649
|
end
|
650
|
+
ruby2_keywords(:process)
|
619
651
|
|
620
|
-
class NullMail
|
652
|
+
class NullMail # :nodoc:
|
621
653
|
def body; "" end
|
622
654
|
def header; {} end
|
623
655
|
|
@@ -636,6 +668,8 @@ module ActionMailer
|
|
636
668
|
end
|
637
669
|
|
638
670
|
# Returns an email in the format "Name <email@example.com>".
|
671
|
+
#
|
672
|
+
# If the name is a blank string, it returns just the address.
|
639
673
|
def email_address_with_name(address, name)
|
640
674
|
self.class.email_address_with_name(address, name)
|
641
675
|
end
|
@@ -687,7 +721,7 @@ module ActionMailer
|
|
687
721
|
# mail.attachments['filename.jpg'] = File.read('/path/to/filename.jpg')
|
688
722
|
#
|
689
723
|
# If you do this, then Mail will take the file name and work out the mime type.
|
690
|
-
# It will also set the Content-Type
|
724
|
+
# It will also set the +Content-Type+, +Content-Disposition+, and +Content-Transfer-Encoding+,
|
691
725
|
# and encode the contents of the attachment in Base64.
|
692
726
|
#
|
693
727
|
# You can also specify overrides if you want by passing a hash instead of a string:
|
@@ -748,7 +782,7 @@ module ActionMailer
|
|
748
782
|
# or an array of addresses.
|
749
783
|
# * +:bcc+ - Who you would like to Blind-Carbon-Copy on this email, can be a string of
|
750
784
|
# addresses, or an array of addresses.
|
751
|
-
# * +:reply_to+ - Who to set the Reply-To header of the email to.
|
785
|
+
# * +:reply_to+ - Who to set the +Reply-To+ header of the email to.
|
752
786
|
# * +:date+ - The date to say the email was sent on.
|
753
787
|
#
|
754
788
|
# You can set default values for any of the above headers (except +:date+)
|
@@ -899,7 +933,7 @@ module ActionMailer
|
|
899
933
|
end
|
900
934
|
|
901
935
|
def apply_defaults(headers)
|
902
|
-
default_values = self.class.default.transform_values do |value|
|
936
|
+
default_values = self.class.default.except(*headers.keys).transform_values do |value|
|
903
937
|
compute_default(value)
|
904
938
|
end
|
905
939
|
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ActionMailer
|
4
|
-
# Returns the version of
|
4
|
+
# Returns the currently loaded version of Action Mailer as a <tt>Gem::Version</tt>.
|
5
5
|
def self.gem_version
|
6
6
|
Gem::Version.new VERSION::STRING
|
7
7
|
end
|
8
8
|
|
9
9
|
module VERSION
|
10
|
-
MAJOR =
|
11
|
-
MINOR =
|
12
|
-
TINY =
|
13
|
-
PRE = "
|
10
|
+
MAJOR = 7
|
11
|
+
MINOR = 0
|
12
|
+
TINY = 8
|
13
|
+
PRE = "6"
|
14
14
|
|
15
15
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
16
16
|
end
|
@@ -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|
|
@@ -23,10 +23,18 @@ module ActionMailer
|
|
23
23
|
}.join("\n\n")
|
24
24
|
|
25
25
|
# Make list points stand on their own line
|
26
|
-
|
27
|
-
formatted.
|
26
|
+
output = +""
|
27
|
+
splits = formatted.split(/(\*+|\#+)/)
|
28
|
+
while line = splits.shift
|
29
|
+
if line.start_with?("*", "#") && splits.first&.start_with?(" ")
|
30
|
+
output.chomp!(" ") while output.end_with?(" ")
|
31
|
+
output << " #{line} #{splits.shift.strip}\n"
|
32
|
+
else
|
33
|
+
output << line
|
34
|
+
end
|
35
|
+
end
|
28
36
|
|
29
|
-
|
37
|
+
output
|
30
38
|
end
|
31
39
|
|
32
40
|
# Access the mailer instance.
|
@@ -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,8 +62,8 @@ 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::
|
66
|
-
#
|
65
|
+
# By default, the email will be enqueued using <tt>ActionMailer::MailDeliveryJob</tt>. Each
|
66
|
+
# ActionMailer::Base class can specify the job to use by setting the class variable
|
67
67
|
# +delivery_job+.
|
68
68
|
#
|
69
69
|
# class AccountRegistrationMailer < ApplicationMailer
|
@@ -88,8 +88,8 @@ 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::
|
92
|
-
#
|
91
|
+
# By default, the email will be enqueued using <tt>ActionMailer::MailDeliveryJob</tt>. Each
|
92
|
+
# ActionMailer::Base class can specify the job to use by setting the class variable
|
93
93
|
# +delivery_job+.
|
94
94
|
#
|
95
95
|
# class AccountRegistrationMailer < ApplicationMailer
|
@@ -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 7.0, 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 and name != :**
|
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,17 @@ module ActionMailer
|
|
45
45
|
self.delivery_job = delivery_job.constantize
|
46
46
|
end
|
47
47
|
|
48
|
+
if options.smtp_settings
|
49
|
+
self.smtp_settings = options.smtp_settings
|
50
|
+
end
|
51
|
+
|
52
|
+
smtp_timeout = options.delete(:smtp_timeout)
|
53
|
+
|
54
|
+
if self.smtp_settings && smtp_timeout
|
55
|
+
self.smtp_settings[:open_timeout] ||= smtp_timeout
|
56
|
+
self.smtp_settings[:read_timeout] ||= smtp_timeout
|
57
|
+
end
|
58
|
+
|
48
59
|
options.each { |k, v| send("#{k}=", v) }
|
49
60
|
end
|
50
61
|
|
@@ -1,26 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module ActionMailer
|
4
|
-
# Provides
|
5
|
-
#
|
3
|
+
module ActionMailer # :nodoc:
|
4
|
+
# Provides
|
5
|
+
# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]
|
6
|
+
# for mailers. Wraps mailer action processing, mail job processing, and mail
|
7
|
+
# delivery to handle configured errors.
|
6
8
|
module Rescuable
|
7
9
|
extend ActiveSupport::Concern
|
8
10
|
include ActiveSupport::Rescuable
|
9
11
|
|
10
12
|
class_methods do
|
11
|
-
def handle_exception(exception)
|
13
|
+
def handle_exception(exception) # :nodoc:
|
12
14
|
rescue_with_handler(exception) || raise(exception)
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
16
|
-
def handle_exceptions
|
18
|
+
def handle_exceptions # :nodoc:
|
17
19
|
yield
|
18
20
|
rescue => exception
|
19
21
|
rescue_with_handler(exception) || raise
|
20
22
|
end
|
21
23
|
|
22
24
|
private
|
23
|
-
def process(
|
25
|
+
def process(...)
|
24
26
|
handle_exceptions do
|
25
27
|
super
|
26
28
|
end
|
@@ -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
@@ -51,13 +51,12 @@ 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!
|
58
57
|
super
|
59
58
|
|
60
|
-
require "
|
59
|
+
require "mail"
|
61
60
|
Mail.eager_autoload!
|
62
61
|
end
|
63
62
|
end
|
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.8.6
|
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: 2024-
|
11
|
+
date: 2024-10-23 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.8.6
|
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.8.6
|
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.8.6
|
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.8.6
|
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.8.6
|
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.8.6
|
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.8.6
|
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.8.6
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mail
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +86,48 @@ dependencies:
|
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 2.5.4
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: net-imap
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: net-pop
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: net-smtp
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
89
131
|
- !ruby/object:Gem::Dependency
|
90
132
|
name: rails-dom-testing
|
91
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,14 +155,12 @@ files:
|
|
113
155
|
- lib/action_mailer.rb
|
114
156
|
- lib/action_mailer/base.rb
|
115
157
|
- lib/action_mailer/collector.rb
|
116
|
-
- lib/action_mailer/delivery_job.rb
|
117
158
|
- lib/action_mailer/delivery_methods.rb
|
118
159
|
- lib/action_mailer/gem_version.rb
|
119
160
|
- lib/action_mailer/inline_preview_interceptor.rb
|
120
161
|
- lib/action_mailer/log_subscriber.rb
|
121
162
|
- lib/action_mailer/mail_delivery_job.rb
|
122
163
|
- lib/action_mailer/mail_helper.rb
|
123
|
-
- lib/action_mailer/mail_with_error_handling.rb
|
124
164
|
- lib/action_mailer/message_delivery.rb
|
125
165
|
- lib/action_mailer/parameterized.rb
|
126
166
|
- lib/action_mailer/preview.rb
|
@@ -138,12 +178,12 @@ licenses:
|
|
138
178
|
- MIT
|
139
179
|
metadata:
|
140
180
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
141
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
142
|
-
documentation_uri: https://api.rubyonrails.org/
|
181
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.8.6/actionmailer/CHANGELOG.md
|
182
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.8.6/
|
143
183
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
144
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
184
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.8.6/actionmailer
|
145
185
|
rubygems_mfa_required: 'true'
|
146
|
-
post_install_message:
|
186
|
+
post_install_message:
|
147
187
|
rdoc_options: []
|
148
188
|
require_paths:
|
149
189
|
- lib
|
@@ -151,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
191
|
requirements:
|
152
192
|
- - ">="
|
153
193
|
- !ruby/object:Gem::Version
|
154
|
-
version: 2.
|
194
|
+
version: 2.7.0
|
155
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
196
|
requirements:
|
157
197
|
- - ">="
|
@@ -159,8 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
199
|
version: '0'
|
160
200
|
requirements:
|
161
201
|
- none
|
162
|
-
rubygems_version: 3.
|
163
|
-
signing_key:
|
202
|
+
rubygems_version: 3.5.16
|
203
|
+
signing_key:
|
164
204
|
specification_version: 4
|
165
205
|
summary: Email composition and delivery framework (part of Rails).
|
166
206
|
test_files: []
|
@@ -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 7.0.
|
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
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
begin
|
4
|
-
require "mail"
|
5
|
-
rescue LoadError => error
|
6
|
-
if error.message.match?(/net\/smtp/)
|
7
|
-
$stderr.puts "You don't have net-smtp installed in your application. Please add it to your Gemfile and run bundle install"
|
8
|
-
raise
|
9
|
-
end
|
10
|
-
end
|