mettle / sendportal

Open-source self-hosted email marketing. Manage your own newsletters at a fraction of the cost.
https://sendportal.io
MIT License
1.78k stars 354 forks source link

How do I configure Sendportal to send 1 email at a time every x minutes when processing a campaign queue? #228

Closed githubcom13 closed 1 year ago

githubcom13 commented 2 years ago

How do I configure Sendportal to send 1 email at a time every x minutes when processing a campaign queue?

Pushkraj19 commented 1 year ago

You kind of. can edit the command file

to

    /**
     * Get all queued campaigns.
     */
    protected function getQueuedCampaigns(): EloquentCollection
    {
        return Campaign::where('status_id', CampaignStatus::STATUS_QUEUED)
            ->where('scheduled_at', '<=', now())
            ->limit(1) //added limit to it
            ->get();
    }

in file vendor/sendportal-core/src/Console/Commands/CampaignDispatchCommand.php

This will limit all campaigns to send 1 email at every 1 minute.