Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

iamarbabhussain's avatar

Newsletter to users

So i have a system where many businesses can add their customers with CSV and Manually. I want to send them newsletter with the use of Queues because the customers will be in thousands. The problem is when a business logs in and newsletter jobs are started and the business logs out, i cannot preserve its id based on which i have to pull its customers. because session would not be there so i cannot have where business_id = session('BUSINESS_ID') condition.

The customers table is many-many with business & customers.

Customers schema: id | business_id | customer_id | created_at | updated_at

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

you create all the queue jobs whilst they are logged in. The job should contain everything it needs to send the email

1 like

Please or to participate in this conversation.