Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / action / src / Plugin / Action / EmailAction.php
index 0f469ec6bfe075d15c696443e223f471b615aff1..1780f3b689bf746e50b898a5cba151f2db8fb9e7 100644 (file)
@@ -139,12 +139,11 @@ class EmailAction extends ConfigurableActionBase implements ContainerFactoryPlug
     }
     $params = ['context' => $this->configuration];
 
-    if ($this->mailManager->mail('system', 'action_send_email', $recipient, $langcode, $params)) {
+    $message = $this->mailManager->mail('system', 'action_send_email', $recipient, $langcode, $params);
+    // Error logging is handled by \Drupal\Core\Mail\MailManager::mail().
+    if ($message['result']) {
       $this->logger->notice('Sent email to %recipient', ['%recipient' => $recipient]);
     }
-    else {
-      $this->logger->error('Unable to send email to %recipient', ['%recipient' => $recipient]);
-    }
   }
 
   /**