comparison lib/tasks/email.rake @ 37:94944d00e43c

* Update to SVN trunk rev 4411
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 19 Nov 2010 13:24:41 +0000
parents 513646585e45
children cbce1fd3b1b7
comparison
equal deleted inserted replaced
22:40f7cfd4df19 37:94944d00e43c
163 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] 163 options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user']
164 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] 164 options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check']
165 165
166 Redmine::POP3.check(pop_options, options) 166 Redmine::POP3.check(pop_options, options)
167 end 167 end
168
169 desc "Send a test email to the user with the provided login name"
170 task :test, :login, :needs => :environment do |task, args|
171 include Redmine::I18n
172 abort l(:notice_email_error, "Please include the user login to test with. Example: login=examle-login") if args[:login].blank?
173
174 user = User.find_by_login(args[:login])
175 abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?
176
177 ActionMailer::Base.raise_delivery_errors = true
178 begin
179 Mailer.deliver_test(User.current)
180 puts l(:notice_email_sent, user.mail)
181 rescue Exception => e
182 abort l(:notice_email_error, e.message)
183 end
184 end
168 end 185 end
169 end 186 end