Mercurial > hg > soundsoftware-site
comparison lib/tasks/email.rake @ 51:371eac10df0b live
* Merge from "cannam" branch. This includes update to Redmine trunk, plus welcome/tip-of-the-day from luisf branch.
author | Chris Cannam |
---|---|
date | Wed, 24 Nov 2010 12:20:08 +0000 |
parents | 94944d00e43c |
children | cbce1fd3b1b7 |
comparison
equal
deleted
inserted
replaced
34:09b1d4349da3 | 51:371eac10df0b |
---|---|
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 |