Email marketing divide contacts in groups

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sujatanipane
Forum Newbie
Posts: 1
Joined: Wed Dec 14, 2016 12:07 am

Email marketing divide contacts in groups

Post by sujatanipane »

I have an application which sends bulk emails to client. I have used PHP to develop this application. But my requirement is when i select list of email ids, If it has 3k contacts then divide that list in 3 groups. means in first group there will be 1k contacts, in second group 1k contacts and so on.

How to do this? Is their any inbuilt function in php to do this? or any other solution? please help me with this.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Email marketing divide contacts in groups

Post by requinix »

array_chunk? It depends what your code is doing...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Email marketing divide contacts in groups

Post by Christopher »

Sounds like it might need a queue. You could have it run at regular intervals and only send a limited number each time the queue is processed. Can be done with a cron on Unix. That allows you to throttle sending to be under any limits. Fill the queue and it slowly empties over time. A queue also give you a record of what is sent, can allow a number of retries on failures, and maybe even de-queue on bounces.
(#10850)
Post Reply