Project

General

Profile

Actions

Defect #11432

closed

Mailer.deliver_recommended_below_threshold(*args) is deprecated

Added by Pavel Vasilyev over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

  Rendered mailer/_issue.text.erb (87.7ms)
  Rendered mailer/issue_edit.text.erb within layouts/mailer (90.6ms)
  Rendered mailer/_issue.html.erb (3.4ms)
  Rendered mailer/issue_edit.html.erb within layouts/mailer (6.0ms)
DEPRECATION WARNING: Mailer.deliver_recommended_below_threshold(*args) is deprecated. 
Use Mailer.recommended_below_threshold(*args).deliver instead. 
(called from method_missing at /srv/redmine/app/models/mailer.rb:426)

Actions #1

Updated by Pavel Vasilyev over 12 years ago

  Rendered mailer/_issue.text.erb (4.5ms)
  Rendered mailer/issue_edit.text.erb within layouts/mailer (7.5ms)
  Rendered mailer/_issue.html.erb (3.1ms)
  Rendered mailer/issue_edit.html.erb within layouts/mailer (5.5ms)
DEPRECATION WARNING: Mailer.deliver_recommended_below_threshold(*args) is deprecated. 
Use Mailer.recommended_below_threshold(*args).deliver instead. 
(called from method_missing at /srv/redmine/app/models/mailer.rb:426)
Completed 500 Internal Server Error in 907ms

NoMethodError (undefined method `recipients' for #<StuffToDoMailer:0xb585f754>):
  app/models/mailer.rb:416:in `initialize'
  app/models/mailer.rb:429:in `method_missing'
  app/models/mailer.rb:427:in `send'
  app/models/mailer.rb:427:in `method_missing'
  app/models/issue.rb:731:in `save_issue_with_child_records'
  app/models/issue.rb:718:in `save_issue_with_child_records'
  app/controllers/issues_controller.rb:182:in `update'
Actions #2

Updated by Toshi MARUYAMA over 12 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Redmine core does not have "recommended_below_threshold".
Please contact plugin author.

Actions #3

Updated by Pavel Vasilyev over 12 years ago

http://www.redmine.org/projects/redmine/repository/revisions/9663/diff/trunk/app/models/mailer.rb

You have broken something in this patch, and plugin stopped working.
Author drunk somewhere. Write API docs, how to convert this to new.

Or just help convert

class StuffToDoMailer < Mailer
  def recommended_below_threshold(user, number_of_next_items)

    recipients Setting.plugin_stuff_to_do_plugin['email_to'].split(',')

    subject "What's Recommended is below the threshold" 

    body(
         :threshold => Setting.plugin_stuff_to_do_plugin['threshold'],
         :count => number_of_next_items,
         :user => user
         )

    part :content_type => "text/plain", :body => render_message("recommended_below_threshold.erb", body)
    part :content_type => "text/html", :body => render_message("recommended_below_threshold.text.html.erb", body)

  end
end
Actions #4

Updated by Pavel Vasilyev over 12 years ago

  • Status changed from Closed to Reopened
Actions #5

Updated by Jean-Philippe Lang over 12 years ago

  • Status changed from Reopened to Closed

Redmine's Mailer was converted to the Rails 3 syntax:
http://guides.rubyonrails.org/action_mailer_basics.html

Actions #6

Updated by Pavel Vasilyev over 12 years ago

Thanks

Actions #7

Updated by Pavel Vasilyev over 12 years ago

Pavel Vasilyev wrote:

Anybody help port this shit to new rails :)

class StuffToDoMailer < Mailer

        layout = 'recommended_below_threshold'

        def recommended_below_threshold(user, number_of_next_items)

                mail(:to => Setting.plugin_stuff_to_do_plugin['email_to'],
                     :subject => "What's Recommended is below the threshold",
                     :threshold => Setting.plugin_stuff_to_do_plugin['threshold'],
                     :count => number_of_next_items,
                     :user => user) do |format|
                        format.html
                        format.text
                     end
        end
end

This code return

ActionView::MissingTemplate (Missing template stuff_to_do_mailer/recommended_below_threshold,
mailer/recommended_below_threshold with {:locale=>[:ru], :handlers=>[:rjs, :erb, :rsb, :builder],
:formats=>[:text]}. Searched in: * "/srv/redmine/app/views"):
Actions

Also available in: Atom PDF