Last active
October 1, 2019 21:44
-
-
Save rcarvs/1c40c4258f001b03d3c281edad912024 to your computer and use it in GitHub Desktop.
The sequential dumb strategy for send a list of e-mails continuously
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$emailsList = News::giveMeNumberAvaiableEmailsAndMarkAsSending($numberOfEmails); | |
foreach ($emailsList as $email) { | |
try { | |
//This task delay seconds and this is bad | |
$send = $email->send(); | |
$email->markAsSend(); | |
} catch (\Exception $e) { | |
$email->markAsFailure($e->getMessage()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment