App-wsgetmail issue with crontab

Hi, I have configured the modern authentication for O365 using App::wsgetmail module, everything works fine when I run the the wsgetmail --config=config1.json via terminal it can access the inbox and create the ticket and mark email as read but when I am trying to use the crontab to do the same work periodically getting no result.
the corntab works with other cornjobs that I have identified for other tasks and only it is not working with wsgetmail.
the crontab looks like this:
*/1 * * * * wsgetmail --config=/opt/rt4/etc/wsgetmail_config/config1.json
Note:
I am using RT4
The config1.json file is executable
I am using root user for configurations

Any idea about this issue that I am facing with?
Thanks in advance!

I have finally resolved the issue and posting the answer here for others that may face with same issue.
The crontab and terminal are two different environments, the wsgetmail perl module command is recognizable for terminal but to make it recognizable for corntab we have to add the full path to the module (wsgetmail) in the crontab.

*/1 * * * * /usr/local/bin/wsgetmail --config=/path_to_config_directory/config1.json

or we can create a shell script and call the script in crontab.
in this case test.sh will looks like this:

#!/bin/bash
/usr/local/bin/wsgetmail --config=account01.json 
/usr/local/bin/wsgetmail --config=account02.json