diff --git a/src/MagicLogin.php b/src/MagicLogin.php index e92549b..bce8b8c 100755 --- a/src/MagicLogin.php +++ b/src/MagicLogin.php @@ -153,6 +153,11 @@ function (ActionEvent $event) { Mailer::class, Mailer::EVENT_BEFORE_SEND, function (MailEvent $event) { + // Skip for console requests (e.g. queue jobs) — getBodyParam() is not available + if (Craft::$app->getRequest()->getIsConsoleRequest()) { + return; + } + if (! $this->request->getBodyParam('magicLoginRegistration')) { return false; }