Class: DamageControl::Publisher::BuildMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/damagecontrol/publisher/email.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_sObject



53
54
55
# File 'lib/damagecontrol/publisher/email.rb', line 53

def to_s
  "Build"
end

Instance Method Details

#email(build, email_publisher, foo = nil, bar = nil) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/damagecontrol/publisher/email.rb', line 38

def email(build, email_publisher, foo=nil, bar=nil)
  @delivery_method = email_publisher.delivery_method
  Log.info("Sending email to #{email_publisher.to.inspect} via #{@delivery_method}")
  @recipients = email_publisher.to.split(%r{,\s*})

  @from = email_publisher.from

  @subject = "#{build.project.name} Build #{build.status_message}"
  @sent_on = Time.new.utc
  @headers['Content-Type'] = "text/html"
  @body["build"] = build
end