Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/tasks/email.rake
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,21 @@ END_DESC

Redmine::POP3.check(pop_options, options)
end

desc "Send a test email to the user with the provided login name"
task :test, :login, :needs => :environment do |task, args|
include Redmine::I18n

user = User.find_by_login(args[:login])
abort l(:notice_email_error, "User #{args[:login]} not found") unless user

ActionMailer::Base.raise_delivery_errors = true
begin
Mailer.deliver_test(User.current)
puts l(:notice_email_sent, user.mail)
rescue Exception => e
abort l(:notice_email_error, e.message)
end
end
end
end