You are here

public function SocialSendEmail::submitConfigurationForm in Open Social 8.9

Same name and namespace in other branches
  1. 8.7 modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
  2. 8.8 modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
  3. 10.3.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
  4. 10.0.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
  5. 10.1.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
  6. 10.2.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()

File

modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php, line 284

Class

SocialSendEmail
An example action covering most of the possible options.

Namespace

Drupal\social_user\Plugin\Action

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);

  // Clean form values.
  $form_state
    ->cleanValues();

  // Get the queue storage entity and create a new entry.
  $queue_storage = $this->storage
    ->getStorage('queue_storage_entity');
  $entity = $queue_storage
    ->create([
    'name' => 'user_email_queue',
    'type' => 'email',
    'finished' => FALSE,
    'field_reply_to' => $form_state
      ->getValue('reply'),
    'field_subject' => $form_state
      ->getValue('subject'),
    'field_message' => $form_state
      ->getValue('message')['value'],
  ]);

  // When the new entity is saved, get the ID and save it within the bulk
  // operation action configuration.
  if ($entity
    ->save()) {
    $this->configuration['queue_storage_id'] = $entity
      ->id();
  }
}