bin/handler-freesmsalert.rb
##
# This method sends the acutal email
#
This method sends the acutal email
This method sends the acutal email
def send_sms(user_id, mail_to, mail_from)
    mail_subject = "Alert:#{@event['check']['name']} #{@event['client']['name']}"
    mail_body = <<-BODY.gsub(/^\s+/, '')
      #{@event['check']['output']}
    BODY
    timeout 10 do
      Mail.deliver do
        to mail_to
        from mail_from
        subject mail_subject
        body mail_body
      end
    end
  rescue Timeout::Error
    puts "#{@settings_key} -- timed out while attempting to send alert for #{user_id} to #{mail_to}"
  end
def send_sms ( user_id , mail_to , mail_from ) mail_subject = "Alert:#{@event['check']['name']} #{@event['client']['name']}" mail_body = <<-BODY . gsub ( / ^ \s + / , '' ) #{ @event [ 'check' ] [ 'output' ] } BODY timeout 10 do Mail . deliver do to mail_to from mail_from subject mail_subject body mail_body end end rescue Timeout :: Error puts "#{@settings_key} -- timed out while attempting to send alert for #{user_id} to #{mail_to}" end
This method sends the acutal email
This method sends the acutal email
user_id
<not_specific>
mail_to
<not_specific>
mail_from
<not_specific>