Project

General

Profile

How to pass keyword parameter in rufus scheduler for redmin-recieve-email configuration?

Added by amit rishi over 6 years ago

I am learning about redmine. Here are some details my redmine setup.

Redmine-version: 3.4.4
Ruby-version: 2.3.1
Rails-version: 4.2.8

I am trying to receive email with rufus scheduler. http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Schedule-email-receiving-with-Rufus-Scheduler

I don't understand how to pass the parameter like project, traker, allow_override etc.

Currently I am passing like this

require 'rubygems'
require 'rake'
require 'rufus-scheduler'

load File.join(Rails.root, 'Rakefile')

load File.join(Rails.root, 'Rakefile')

ENV['host']='imap-mail.outlook.com'
ENV['port']='993'
ENV['ssl']='true'

ENV['project'] = 'myproject'
ENV['tracker']='bug'
ENV['allow_override']='all'

scheduler = Rufus::Scheduler.new
  1. Check emails every 1 mins
    scheduler.interval '1m' do
    task = Rake.application['redmine:email:receive_imap']
    task.reenable
    task.invoke
    end

This is working fine but I don't pass these parameter as ENVIRONMENT variable.

I was trying to pass this way, task = Rake.application['redmine:email:receive_imap project=myproject tracker=bug allow_override=all']
But I didn't work.

Can someone tell me the correct way to pass these parms to receive_imap task? Any help would be appreciated. Thanks.


    (1-1/1)