CampaignMonitorLocalResetForm.php in Campaign Monitor 8
File
modules/campaignmonitor_local/src/Form/CampaignMonitorLocalResetForm.php
View source
<?php
namespace Drupal\campaignmonitor_local\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class CampaignMonitorLocalResetForm extends FormBase {
public function getFormId() {
return 'campaignmonitor_local_reset_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$text = 'Submitting this form will create the subscriptions queue ready for processing.';
$text .= ' Run this first before processing the queue.';
$form['help'] = [
'#type' => 'markup',
'#markup' => $this
->t($text),
];
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Create queue'),
'#button_type' => 'primary',
];
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
campaignmonitor_local_insert_list_data();
campaignmonitor_local_queue_subscriptions();
}
}