You are here

class EmailActivitySendAdvancedQueue in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/custom/social_advanced_queue/src/Plugin/ActivitySend/EmailActivitySendAdvancedQueue.php \Drupal\social_advanced_queue\Plugin\ActivitySend\EmailActivitySendAdvancedQueue
  2. 10.2.x modules/custom/social_advanced_queue/src/Plugin/ActivitySend/EmailActivitySendAdvancedQueue.php \Drupal\social_advanced_queue\Plugin\ActivitySend\EmailActivitySendAdvancedQueue

Ensures the'EmailActivitySend' activity action uses Advanced Queue Jobs.

Hierarchy

Expanded class hierarchy of EmailActivitySendAdvancedQueue

1 file declares its use of EmailActivitySendAdvancedQueue
social_advanced_queue.module in modules/custom/social_advanced_queue/social_advanced_queue.module
Module file for Social Advanced Queue.

File

modules/custom/social_advanced_queue/src/Plugin/ActivitySend/EmailActivitySendAdvancedQueue.php, line 12

Namespace

Drupal\social_advanced_queue\Plugin\ActivitySend
View source
class EmailActivitySendAdvancedQueue extends EmailActivitySend {

  /**
   * {@inheritdoc}
   */
  public function create($entity) {
    $data = [];
    $data['entity_id'] = $entity
      ->id();

    // Create a new Email Job and add to the "default" queue using
    // advanced queue API instead of SocialSendEmails default Core Queue.
    $job = Job::create('activity_send_email_worker', $data);
    if ($job instanceof Job) {
      $queue = Queue::load('default');
      $queue
        ->enqueueJob($job);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EmailActivitySendAdvancedQueue::create public function Create a new item in queue on the action with some logic behind it. Overrides EmailActivitySend::create
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 2
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 98