Skip to content

Instantly share code, notes, and snippets.

@ninjs
Created April 16, 2015 19:14
Show Gist options
  • Save ninjs/8f56e5a8f96728b87d8e to your computer and use it in GitHub Desktop.
Save ninjs/8f56e5a8f96728b87d8e to your computer and use it in GitHub Desktop.
class Email
attr_accessor :is_set, :alertname, :from, :to, :subject, :priority, :include_trigger, :include_trigger_time, :reportServerEnabled, :inline, :sendresults, :useNSSubject
def initialize(is_set: "1", alertname: "no-reply@email", from: "no-reply@email", to: "no-reply@email", priority: "2", include_trigger: "1", include_trigger_time: "1", reportServerEnabled: "0", inline: "1", sendresults: "1", useNSSubject: "1")
@is_set = is_set
@alertname = alertname
@from = "\" " + alertname + " \"" + from
@to = to
@subject = alertname
@priority = priority
@include_trigger = include_trigger
@include_trigger_time = include_trigger_time
@reportServerEnabled = reportServerEnabled
@inline = inline
@sendresults = sendresults
@useNSSubject = useNSSubject
end
def print
puts "action.email = " + @is_set
puts "action.email.from = " + @from
puts "action.email.to = " + @to
puts "action.email.subject = " + @subject
puts "action.email.priority = " + @priority
puts "action.email.include.trigger = " + @include_trigger
puts "action.email.include.trigger.time = " + @include_trigger_time
puts "action.email.reportServerEnabled = " + @reportServerEnabled
puts "action.email.inline = " + @inline
puts "action.email.sendresults = " + @inline
puts "action.email.useNSSubject = " + @sendresults
end
end
email = Email.new(alertname: "test")
print email.alertname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment