Skip to content
Snippets Groups Projects

Deprecated using a function callback for sending mail; should be done by...

1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -3,6 +3,7 @@
namespace Drupal\mandrill\Plugin\QueueWorker;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\Core\Queue\RequeueException;
/**
* Sends queued mail messages.
@@ -30,7 +31,10 @@ class MandrillQueueProcessor extends QueueWorkerBase {
/* @var $mandrill \Drupal\mandrill\MandrillService */
$mandrill = \Drupal::service('mandrill.service');
$mandrill->send($data['message']);
$result = $mandrill->send($data['message']);
if(!$result){
throw new RequeueException('Mandrill send request had an exception!');
}
}
}
Loading