internetee-registry/app/mailers/contact_mailer.rb
2015-09-03 11:40:03 +03:00

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