Refactor NotificationMailer to use parameterization (#25718)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2023-07-10 03:06:22 +02:00
1 parent a1f5188c8c
commit f3fca78756
4 files changed
+73 -55

No files matched your search

+6 -1
View File
@@ -162,7 +162,12 @@ class NotifyService < BaseService
end
def send_email!
NotificationMailer.public_send(@notification.type, @recipient, @notification).deliver_later(wait: 2.minutes) if NotificationMailer.respond_to?(@notification.type)
return unless NotificationMailer.respond_to?(@notification.type)
NotificationMailer
.with(recipient: @recipient, notification: @notification)
.public_send(@notification.type)
.deliver_later(wait: 2.minutes)
end
def email_needed?