Skip to content

Commit a77ac69

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

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/supermail.rb

Lines changed: 12 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,17 @@ 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(ActionMailer::Base, :mail,
34+
to:,
35+
from:,
36+
cc:,
37+
bcc:,
38+
subject:,
39+
body:
40+
)
3241
end
3342
end
3443
end

0 commit comments

Comments
 (0)