0
0
Fork 0

Refactor NotificationMailer to use parameterization (#25718)

This commit is contained in:
Matt Jankowski 2023-07-09 21:06:22 -04:00 committed by GitHub
parent a1f5188c8c
commit f3fca78756
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 55 deletions

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?