app/models/ticket.rb
# Send email for this ticket.
Send email for this ticket.
Send email for this ticket .
def send_email
    self.sending_email!
    begin
      ApplicationMailer.ticket_email(self).deliver 
    rescue Exception => e
      self.update_attribute :report, "Could not send email: #{e.class.name}, #{e.message}"
      self.failed_to_send_email!
    else
      self.sent_email!
    end
  end
def send_email self . sending_email! begin ApplicationMailer . ticket_email ( self ) . deliver rescue Exception => e self . update_attribute :report , "Could not send email: #{e.class.name}, #{e.message}" self . failed_to_send_email! else self . sent_email! end end
Send email for this ticket.
Send email for this ticket .
# TODO use deliver_later when upgraded to Rails 4.2 # TODO catch specific exception?