Sha256: e7e5c9db236ba68f30119485e87f4d1243b6955f9209263336b8f4f4d809edea
Contents?: true
Size: 1.13 KB
Versions: 56
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true # == Schema Information # # Table name: email_logs # # id :bigint not null, primary key # event :string # log_level :string # severity :string # timestamp :bigint # created_at :datetime not null # updated_at :datetime not null # email_id :bigint indexed # log_id :string # message_id :string # # Foreign Keys # # fk_rails_... (email_id => emails.id) # class EmailLog < ApplicationRecord audited belongs_to :email, optional: true after_create_commit do email.update_status! if email.present? end def status_for_email case event when 'accepted' 'accepted' when 'delivered' 'delivered' when 'failed' if severity == 'permanent' 'rejected' elsif severity == 'temporary' 'accepted' else # :nocov: pg_warn 'No se pudo detectar el status de email', self nil # :nocov: end when 'opened' # No cambia el status else # :nocov: pg_warn 'No se pudo detectar el status de email', self nil # :nocov: end end end
Version data entries
56 entries across 56 versions & 1 rubygems