Project

General



Profile

« Previous | Next » 

Revision 1174

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

View differences:

trunk/app/models/mailer.rb
122 122
    subject 'Redmine test'
123 123
    body :url => url_for(:controller => 'welcome')
124 124
  end
125
  
125

  
126
  # Overrides default deliver! method to prevent from sending an email
127
  # with no recipient, cc or bcc
128
  def deliver!(mail = @mail)
129
    return false if (recipients.nil? || recipients.empty?) && 
130
                    (cc.nil? || cc.empty?) &&
131
                    (bcc.nil? || bcc.empty?)
132
    super
133
  end
134

  
126 135
  private
127 136
  def initialize_defaults(method_name)
128 137
    super

Also available in: Unified diff