Project

General

Profile

Defect #15113 ยป mailer_return_value.patch

Florian Schwab, 2013-10-12 14:11

View differences:

app/models/mailer.rb
392 392
    ActionMailer::Base.delivery_method = saved_method
393 393
  end
394 394

  
395
  def mail(headers={})
395
  def mail(headers={}, &block)
396 396
    headers.merge! 'X-Mailer' => 'Redmine',
397 397
            'X-Redmine-Host' => Setting.host_name,
398 398
            'X-Redmine-Site' => Setting.app_title,
......
426 426
      headers[:references] = @references_objects.collect {|o| "<#{self.class.message_id_for(o)}>"}.join(' ')
427 427
    end
428 428

  
429
    super headers do |format|
430
      format.text
431
      format.html unless Setting.plain_text_mail?
432
    end
433

  
434 429
    set_language_if_valid @initial_language
430

  
431
    if block_given?
432
      super headers, &block
433
    else
434
      super headers do |format|
435
        format.text
436
        format.html unless Setting.plain_text_mail?
437
      end
438
    end
435 439
  end
436 440

  
437 441
  def initialize(*args)
    (1-1/1)