internetee-registry/app/mailers/contact_mailer.rb
2015-07-28 21:47:57 +03:00

26 lines
750 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: 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