Refactor NotificationMailer
to use parameterization (#25718)
This commit is contained in:
parent
a1f5188c8c
commit
f3fca78756
4 changed files with 73 additions and 55 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue