I am using Illuminate Queue in Codeigniter (in a Vagrant Homestead box) and have successfully set up the listening command, as well as the class that gets called when the queue worker gets the job off of the queue (Iron in this case).
Here is the class:
<?php namespace MyApp\Queues\Listeners\ClassToBeCalled;
class ClassToBeCalled
{
public function fire($job, $data)
{
$message = isset($data['message']) ? $data['message'] : 'No message was set';
mail('test@test.com', 'Test Message', $message);
$job->delete();
}
}
The job does get deleted off of Iron when the fire method is ran, but the email does not send (test@test.com is just for this stack question, the actual email address is valid).
Originally I was getting sh: /usr/sbin/sendmail Not Found in the CL when running the listener command and have since installed sendmail in Homestead and I no longer receive that error message. Here is the php.ini settings for the sendmail:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
; sendmail_path =
I tried changing sendmail_path to sendmail_path = /usr/sbin/sendmail -t -i and uncommenting it but that didn't do anything.
Any help is greatly appreciated!