How to set environment when calling rake task inside another

This is what I have inside a rake task. In this rake task I need to
call
another rake task called email:send_messages. However I need to pass
the
RAILS_ENV as 'staging'.

Rake::Task["rake:email:send_messages"].invoke

I tried a lot of variations but none of them work.

Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging
Rake::Task["rake:email:send_messages RAILS_ENV=staging"].invoke

Random guess: set ENV['RAILS_ENV'] before you invoke that rake task.

Fred