public function SocialSendEmail::submitConfigurationForm in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
- 8.7 modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
- 8.8 modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
- 10.0.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
- 10.1.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
- 10.2.x modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php \Drupal\social_user\Plugin\Action\SocialSendEmail::submitConfigurationForm()
Default configuration form submit handler.
This method will be needed if a child class will implement \Drupal\Core\Plugin\PluginFormInterface. Code saver.
Parameters
array &$form: Form array.
\Drupal\Core\Form\FormStateInterface $form_state: The form state object.
Overrides ViewsBulkOperationsActionBase::submitConfigurationForm
File
- modules/
social_features/ social_user/ src/ Plugin/ Action/ SocialSendEmail.php, line 298
Class
- SocialSendEmail
- An example action covering most of the possible options.
Namespace
Drupal\social_user\Plugin\ActionCode
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();
}
}