Skip to content

Commit

Permalink
avoid 404 error if email tracker has been deleted
Browse files Browse the repository at this point in the history
This PR solves this issue that currently happens when an email tracker has been deleted and users get a 404 error when they click on links in their emails.
  • Loading branch information
Khuthaily authored and jdavidbakr committed Jan 14, 2024
1 parent 84de1ad commit b878355
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MailTrackerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function linkClicked($url, $hash)
$url = config('mail-tracker.redirect-missing-links-to') ?: '/';
}
$tracker = MailTracker::sentEmailModel()->newQuery()->where('hash', $hash)
->firstOrFail();
->first();
if ($tracker) {
RecordLinkClickJob::dispatch($tracker, $url, request()->ip())
->onQueue(config('mail-tracker.tracker-queue'));
Expand Down

0 comments on commit b878355

Please sign in to comment.