Project

General

Profile

« Previous | Next » 

Revision 722ef9a8

Added by Ohad Levy about 14 years ago

  • ID 722ef9a832853a48bc335a10b53d96b36beb7555

fixes #241 - email notifications don't work when mail relay requires domain name

View differences:

app/models/host_mailer.rb
email = options[:email] || SETTINGS[:administrator] || User.all(:select => :mail).map(&:mail)
raise "unable to find recipients" if email.empty?
recipients email
from "Foreman-noreply"
from "Foreman-noreply@" + Facter.domain
subject "Summary Puppet report from Foreman"
sent_on Time.now
time = options[:time] || 1.day.ago
......
email = SETTINGS[:administrator] if email.empty?
raise "unable to find recipients" if email.empty?
recipients email
from "Foreman-noreply"
from "Foreman-noreply@" + Facter.domain
subject "Puppet error on #{host.to_label}"
sent_on Time.now
content_type "text/html"

Also available in: Unified diff