Skip to content

Commit 2dfe921

Browse files
committed
Fix bug from Rails 8.2.x regression
1 parent 3cc5c8d commit 2dfe921

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lib/supermail.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Base
1414
:deliver_now,
1515
:deliver_later,
1616
:message,
17-
to: :action_mailer_base_mail
17+
to: :action_mailer_message_delivery
1818

1919
def to = nil
2020
def from = nil
@@ -27,8 +27,19 @@ def body = ""
2727
def mailto = MailTo.href(to:, from:, cc:, bcc:, subject:, body:)
2828
alias :mail_to :mailto
2929

30-
private def action_mailer_base_mail
31-
ActionMailer::Base.mail(to:, from:, cc:, bcc:, subject:, body:)
30+
# This is a bizzar work around for a commit that broke https://github.com/rails/rails/commit/c594ba4ffdb016c7b2a22055f41dfb2c4409594d
31+
# further proving the bewildering maze of indirection in Rails ActionMailer.
32+
private def action_mailer_message_delivery
33+
ActionMailer::MessageDelivery.new(
34+
ActionMailer::Base,
35+
:mail,
36+
to:,
37+
from:,
38+
cc:,
39+
bcc:,
40+
subject:,
41+
body:
42+
)
3243
end
3344
end
3445
end

0 commit comments

Comments
 (0)