Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/Jobs/SendPolicyAnnouncementJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
use App\User;
use Illuminate\Support\Facades\Notification;

/**
* WARNING: This job is NOT idempotent. DO NOT RUN IT MULTIPLE TIMES.
* There is also no error handling or mechanism for recording which users have been sent an email.
*
* This has created an issue on production where a user with an empty string as an email address
* (due to a request to remove PII) caused Notification::send() to throw an error and the remaining
* emails to not be sent.
*
* DO NOT REPEAT THIS PATTERN FOR OTHER JOBS
*/
class SendPolicyAnnouncementJob extends Job {
public function handle() {
$users = User::query()->whereNotNull('email')->get();
Expand Down
Loading