msigley / osticket-msgraph-mailfetcher

6 stars 1 forks source link

Configuration not defined #2

Open GamerClassN7 opened 3 weeks ago

GamerClassN7 commented 3 weeks ago

hello, i am trying to use your awesome plugin on Os ticket v18, ant it seems like $this is not accesible propertly inside cron ? any idea why that could be ?.

image

msigley commented 3 weeks ago

What version of OSTicket are you trying to use the plugin with?

GamerClassN7 commented 2 weeks ago

Hi, I am tryiing to use plugin with latest version osTicket Core, v1.18.1 i dont have extensive knowledge abouth OSTicket Plugin sytem how ever i managed to make working wersion of your plugin. All changes cna be found in my Fork.

https://github.com/GamerClassN7/osticket-msgraph-mailfetcher

Clould you please look in to the changes and adwise me i thay can be don in better way ?

Also i have additional question would be possible to incorporate also sending of emails over API ?

Thank you in advance !

msigley commented 2 weeks ago

I briefly reviewed your fix. I think you may be working around the issue by referencing $config directly by referencing $this->config instead of $config. The bigger question is why $config isn't being passed to the cron callback as it is supposed to. Its possible OS Ticket made some changes to the Plugin API in 1.18 I am not aware of. I haven't updated my OS Ticket instance in production to 1.18 yet.

I am aware of Microsoft depreciating SMTP access. I am currently working around that by using Sparkpost to send emails (SMTP2GO is also a popular choice). I do plan on implmenting sending via the msgraph API (https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http), but it is not currently on my calendar of todos.

Please feel free to open a pull request and reference this issue. If you would like my feedback on code changes it would definitely be easier that way.