Class: DelayedMailhopper::SendJob

Inherits:
Struct
  • Object
show all
Defined in:
app/models/delayed_mailhopper/send_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'app/models/delayed_mailhopper/send_job.rb', line 2

def id
  @id
end

Instance Method Details

#error(job, e) ⇒ Object



11
12
13
14
# File 'app/models/delayed_mailhopper/send_job.rb', line 11

def error(job, e)
  Rails::logger.error "[DelayedMailhopper::SendJob] error for email_id #{id}, delayed_job_id #{job.id}\n" +
                      "#{e.class}\n#{e.message}\n\n=== BACKTRACE ===\n" + e.backtrace.join("\n")
end

#performObject



3
4
5
# File 'app/models/delayed_mailhopper/send_job.rb', line 3

def perform
  Email.find(id).send!
end

#success(job) ⇒ Object



7
8
9
# File 'app/models/delayed_mailhopper/send_job.rb', line 7

def success(job)
  Rails::logger.info "[DelayedMailhopper::SendJob] success for email_id #{id}, delayed_job_id #{job.id}"
end