Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With regards to the first question; it's best to create the script to send the next x emails from the recipients list and call it repetitively until all the recipients have been processed. You'll need to keep track of who's been processed in the db and introduce error handling in case it fails; a good strategy is for each user:</p> <ul> <li>mark in db as processing</li> <li>send recipient email</li> <li>mark in db as processed</li> </ul> <p>This way you can see how many people failed at the end (i.e. those who still are marked as "processing").</p> <p>In order to repeat the process you could use CRON and repeat every minute; but what if the sending takes over 1 minute (e.g. due to slow SMTP connection) then you'll have two processes running together so you'll either need to prevent this or introduce some sort of locking (the above example of marking users as "processing" will prevent two concurrent instances of the script from processing the same people).</p> <p>The other problem with CRON every minute is that it might take you ages to send all your emails. I had this exact problem and so I wrote The Fat Controller which handles parallel processing and repeating for you. I made a simple shell script which is started every day by CRON and runs The Fat Controller which then runs many instances of the PHP sending script. Here are some use cases and more information:</p> <p><a href="http://fat-controller.sourceforge.net/use-cases.html" rel="nofollow">http://fat-controller.sourceforge.net/use-cases.html</a></p> <p>With regards to your second question; I'm not sure of the internals of Swift mailer, but you'll want to open an SMTP connection, send emails, then close it - so you're not opening and closing a connection for each email. Check the documentation, I've used Swift before and it worked very well and had very clear documentation.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload