mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 02:46:21 +00:00
no fallar con direcciones no válidas
This commit is contained in:
parent
73f3b26231
commit
d96dd895fa
1 changed files with 9 additions and 3 deletions
|
@ -22,9 +22,15 @@ class MaintenanceJob < ApplicationJob
|
|||
|
||||
# XXX: Parece que [0] es más rápido que []#first
|
||||
Usuarie.all.pluck(:email, :lang).each do |u|
|
||||
MaintenanceMailer.with(maintenance: maintenance,
|
||||
email: u[0],
|
||||
lang: u[1]).send(mailer).deliver_now
|
||||
begin
|
||||
MaintenanceMailer.with(maintenance: maintenance,
|
||||
email: u[0],
|
||||
lang: u[1]).public_send(mailer).deliver_now
|
||||
rescue Net::SMTPServerBusy => e
|
||||
# Algunas direcciones no son válidas, no queremos detener el
|
||||
# envío pero sí enterarnos cuáles son
|
||||
ExceptionNotifier.notify_exception e
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue