Skip to content
Snippets Groups Projects
Commit 35b4c6bf authored by Steve Wirt's avatar Steve Wirt
Browse files

Issue #3442082 by swirt: Module setting checkboxes are confusing

parent 4d60066d
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,14 @@ This module provides a set of utilities to have your Drupal powered site use Gov
It is more focused in function than the GovDelivery Integration module https://www.drupal.org/project/govdelivery.
## How to use the service to add a bulletin to the queue.
## FAQs
### During initial setup and testing, how do I make sure I am not sending Bulletins?
The two checkboxes in the "Basic operations" section of the admin should start
out being disabled. With them off, Bulletins are not queued and the queue is
not processed. **Caution** Only turn them both on when you are ready to send.
### How to use the service to add a bulletin to the queue.
The service to add a Bulletin to the queue can be called from anything that you
would like to have perform this [ Example: hook_entity_insert(),
hook_entity_update(), hook_entity_presave(), hook_update_N(), custom event
......@@ -46,7 +53,7 @@ To add a test, it would look like this.
GovDelivery Bulletins API https://developer.govdelivery.com/api/comm_cloud_v1/Default.htm#API/Comm%20Cloud%20V1/API_CommCloudV1_Bulletins_CreateandSendBulletin.htm
## How to securely store GovDelivery API endpoint, username and password.
### How to securely store GovDelivery API endpoint, username and password.
Should be stored in settings.local.php, like so:
```
......@@ -68,7 +75,6 @@ Bulletins Admin form /admin/config/services/govdelivery-bulletins/settings.
This is strongly discouraged, and presents a security vulnerability.
## FAQs
### Why does this use a queue?
......
......@@ -23,22 +23,33 @@ class GovDeliveryBulletinsAdminForm extends FormBase {
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('govdelivery_bulletins.settings');
$form['enable_bulletin_queuing'] = [
$form['circuit-breakers'] = [
'#type' => 'fieldset',
'#title' => $this->t('Basic operations'),
];
$into_text = $this->t('Bulletins to be sent are first added to a queue, and then the queue is processed.'). '</br>';
$into_text .= $this->t('When the queue item is processed, it is sent to GovDelivery'). '</br>';
$into_text .= $this->t('To be fully operational, both of these must be enabled.');
$form['circuit-breakers']['introduction'] = [
'field_label' => [
'#type' => 'markup',
'#markup' => $into_text,
],
];
$form['circuit-breakers']['enable_bulletin_queuing'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enable Bulletin Queuing'),
'#description' => $this->t(
'Enables calls of Service AddBulletinToQueue to actually add to the queue. Useful for disabling for testing. If disabled, will still write to log.'
),
'#title' => $this->t('Enable bulletin queuing.'),
'#description' => $this->t('Add Bulletins to the queue when the service AddBulletinToQueue() is called. If disabled, it will still write the fake Bulletin addition to the Drupal log, which is useful for testing.'),
'#weight' => '0',
'#default_value' => $config->get('enable_bulletin_queuing'),
];
$form['enable_bulletin_queue_sends_to_govdelivery'] = [
$form['circuit-breakers']['enable_bulletin_queue_sends_to_govdelivery'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enable Bulletin Queue Sends to GovDelivery API'),
'#description' => $this->t(
'Enables the queue to post to the GovDelivery Bulletin API. Useful for disabling for testing. If disabled, will still write to log.'
),
'#title' => $this->t('Enable bulletin queue sending to GovDelivery API.'),
'#description' => $this->t('Enable the queue processor to post to the GovDelivery Bulletin API. If disabled, will not actually send, but will still write to log, which is useful for testing.'),
'#weight' => '2',
'#default_value' => $config->get('enable_bulletin_queue_sends_to_govdelivery'),
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment