Do not send an email with no recipient, cc or bcc (closes #743).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1174 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-02-26 18:30:24 +00:00
parent 328df74dd1
commit 8531e176aa
1 changed files with 10 additions and 1 deletions

View File

@ -123,6 +123,15 @@ class Mailer < ActionMailer::Base
body :url => url_for(:controller => 'welcome')
end
# Overrides default deliver! method to prevent from sending an email
# with no recipient, cc or bcc
def deliver!(mail = @mail)
return false if (recipients.nil? || recipients.empty?) &&
(cc.nil? || cc.empty?) &&
(bcc.nil? || bcc.empty?)
super
end
private
def initialize_defaults(method_name)
super