Method: Notification#send_notification

Defined in:
lib/app/models/notification.rb

#send_notificationObject

Send the notification



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/app/models/notification.rb', line 115

def send_notification
  if state.eql? STATE_NEW
    self.state = STATE_SUBMITTED
  else
    self.retries = 0
    self.state = STATE_RESUBMITTED
    self.error_message = 'Retrying'
  end

  begin
    deliver_message if save!
  rescue StandardError => error
    finish_processing error.message
  end
end