17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/tolliver/services/methods/email.rb', line 17
def deliver(notification_receiver)
return false if provider.nil?
notification = notification_receiver.notification_delivery.notification
begin
provider.deliver(notification, notification_receiver)
notification_receiver.status = 'sent'
rescue StandardError => e
notification_receiver.status = 'error'
notification_receiver.error_message = e.message
end
notification_receiver.sent_at = Time.current
notification_receiver.save
true
end
|