sendportal
sendportal copied to clipboard
php artisan queue:work --queue=sendportal-message-dispatch this command is not working when run this command in my terminal it appears nothing and i also change QUEUE_CONNECTION=database but still nothing is showing
Just ran into this. When using QUEUE_CONNECTION=database, it appears those queues, sendportal-message-dispatch and sendportal-webhook-process, are not used by the software. I was able to get it working using
php artisan queue:work --queue=default
Hope this helps.
I set in .env
the QUEUE_CONNECTION=database
.
And i run:
php artisan queue:table
php artisan migrate
and i tried the following commands:
php artisan queue:work --queue=sendportal-message-dispatch
php artisan queue:work --queue=sendportal-webhook-process
php artisan queue:work --queue=default
But nothing happens with any of the queue:work
command...
Any other recommondations how i can run a Campaign and not get stuck in "Queued"?
I set in
.env
theQUEUE_CONNECTION=database
.And i run:
php artisan queue:table php artisan migrate
and i tried the following commands:
php artisan queue:work --queue=sendportal-message-dispatch php artisan queue:work --queue=sendportal-webhook-process php artisan queue:work --queue=default
But nothing happens with any of the
queue:work
command...
Any other recommondations how i can run a Campaign and not get stuck in "Queued"?
When you "sent" the campaign, did you select "Send Immediately" or "Queue draft" for sending behavior?
The other thing you can do is pull up the database and find the jobs (?) table. Look for a column "queue" and see what the name is. In my instance they are all going in as "default" but maybe yours is different?
Thank you for your fast response @bmenking-wng
I tried both there, "Send automatically" and "Queue draft":
but they are getting all "Queued" status:
i have both tables jobs
and failed_jobs
, but they are always empty:
Is that the problem, should there be entries in jobs
?
Thank you for your fast response @bmenking-wng I tried both there, "Send automatically" and "Queue draft":
but they are getting all "Queued" status:
i have both tables
jobs
andfailed_jobs
, but they are always empty:Is that the problem, should there be entries in
jobs
?
So the issue I ran into was that incoming opens and click notifications from AWS SNS were not getting processed by the queue. I don't think email sending uses the queue, but I could be wrong.
Check to see if the cron job from the docs is running https://sendportal.io/docs/v2/getting-started/configuration-and-setup#additional-configuration
Under the Messages section if you click on the "Draft" tab you may see all the unsent email messages. Enabling that cron job should start pushing those "Send Immediately" messages out to the email provider that is configured.
Thank your very much @bmenking-wng for your hint with the cron job. The schedule:run
did the job and all Campaigns have been sent out and i see the jobs in the jobs database table.
> php artisan schedule:run
[2023-12-20T23:22:32+00:00] Running scheduled command: Dispatch all campaigns waiting in the queue
I configure this for a friend and i found out he has just a simple webspace with PHP/MySQL and no SSH/cronjob access. I switched back to QUEUE_CONNECTION=sync
and it seems like this also needs the cron job. But docs say:
The synchronous queue runs any queued jobs as they are requested, requiring the user to wait until the job has been completed before any further action can be taken.
For me it sounds like it sends the messages directly after saving the Campaign, why it needs then the cron job? Anyway, it looks like Sendportal is then not useable on a simple webspace? Maybe i open a new issue for this question...
Thank your very much @bmenking-wng for your hint with the cron job. The
schedule:run
did the job and all Campaigns have been sent out and i see the jobs in the jobs database table.> php artisan schedule:run [2023-12-20T23:22:32+00:00] Running scheduled command: Dispatch all campaigns waiting in the queue
I configure this for a friend and i found out he has just a simple webspace with PHP/MySQL and no SSH/cronjob access. I switched back to
QUEUE_CONNECTION=sync
and it seems like this also needs the cron job. But docs say:The synchronous queue runs any queued jobs as they are requested, requiring the user to wait until the job has been completed before any further action can be taken.
For me it sounds like it sends the messages directly after saving the Campaign, why it needs then the cron job? Anyway, it looks like Sendportal is then not useable on a simple webspace? Maybe i open a new issue for this question...
If you cannot setup cron jobs then "sync" is what you would want. Most likely it processes queue jobs each time a page is loaded on the website. Had a project that operated this way and we used an external cron job to load the front page every two minutes so it would process queue jobs.
Another way to do this may be to create an API that kicks off queue jobs. That way an external cron could be used. This may get you in the direction of that solution: https://stackoverflow.com/questions/32124592/laravel-run-queue-work-from-code
Thank you again for your input @bmenking-wng.
Most likely it processes queue jobs each time a page is loaded on the website.
Yes, that is what i expected, too. I asked ChatGPT, it says the same:
[...] If you set
QUEUE_CONNECTION=sync
, you essentially disable the queue system, and the jobs will be processed synchronously as part of the web request. [...]
But nothing happens, i clicked every page of my Sendportal app, but the Campaigns keep Queued
:
I also checked config/queue.php
in my Laravel directory as you noticed in StackOverflow, but it looks also fine for me:
[...]
'default' => env('QUEUE_CONNECTION', 'sync'),
[...]
'connections' => [
'sync' => [
'driver' => 'sync',
],
[...]
-
\storage\logs\laravel.log
is empty - i cleared the cache with
php artisan cache:clear
andphp artisan config:clear
- i set up again the dummy project and just initialized the
.env
with the basic db connection / app / user settings and one email service... same result (PHP 8.2.12
) - used in Campaign always: SCHEDULE="Dispatch now" and SENDING BEHAVIOUR="Send automatically"
- If i call
php artisan schedule:run
the get dispatched... but that is not what i want?
I have no idea, what else i could do or what it could be? 🤷🏽♂️
I also faced the same issue but found a way.
You need to create a schedule job in cpanel if you are working on hosting the panel and use this command your hosting path here/project main directory name/artisan sp:campaigns:dispatch
Thank you for your input @deadlyanony. Sadly, at this webspace are no scheduled tasks / cron jobs available. I can just add files over FTP, modifiy database over phpmyadmin or update php.ini settings.
Also i still dont understand why this is necessary if i choose SYNC
- should it not send straight after i clicked the save-Campaign-button?