mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
26 lines
758 B
Ruby
26 lines
758 B
Ruby
class ContactMailer < ApplicationMailer
|
|
def email_updated(email, contact)
|
|
return if delivery_off?(contact)
|
|
|
|
@contact = contact
|
|
|
|
return if whitelist_blocked?(email)
|
|
begin
|
|
mail(to: format(email), subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]")
|
|
rescue EOFError,
|
|
IOError,
|
|
TimeoutError,
|
|
Errno::ECONNRESET,
|
|
Errno::ECONNABORTED,
|
|
Errno::EPIPE,
|
|
Errno::ETIMEDOUT,
|
|
Net::SMTPAuthenticationError,
|
|
Net::SMTPServerBusy,
|
|
Net::SMTPFatalError,
|
|
Net::SMTPSyntaxError,
|
|
Net::SMTPUnknownError,
|
|
OpenSSL::SSL::SSLError => e
|
|
logger.info "EMAIL SENDING FAILED: #{email}: #{e}"
|
|
end
|
|
end
|
|
end
|