As a developer it would be nice to have a service class to send a bulletin to GovDelivery. It would take data from the queue item (or passed directly) and send the bulletin.

It should have a validate method that makes sure it has enough data for a successful send.
It should return any error message or success message received from the GovDelivery Bulletins API
The queue worker would call this service for each bulletin in the queue.

Comments

swirt created an issue. See original summary.

swirt’s picture

swirt’s picture

The service should wrap the final call in a check or this setting `enable_bulletin_sends_to_govdelivery` so that:
if it is enabled, sending to govdelivery wlll happen and the event is logged.
if it is not enabled, sending to govdelivery does not happen and the non-send event is logged as such.

swirt’s picture

The config setting is currently `enable_bulletin_queue_sends_to_govdelivery` but it should really be not specific to the queue so it should become `enable_bulletin_sends_to_govdelivery`. Basically just a kill switch to keep this Service from sending a bulletin regardless of whether the queue worker called it or some other custom code called the service.

swirt’s picture

Priority: Normal » Critical

Changed this to critical as it is needed for initial release.

Elijah Lynn’s picture

Assigned: Unassigned » Elijah Lynn
swirt’s picture

Disregard everything I said in #4 .

All the validation formulation takes place during add the item to the queue, so there is no reason to make the setting separate from the queue. or at least it is not as critical.

Elijah Lynn’s picture

  • Elijah Lynn authored 8a00dd8 on 8.x-1.x
    Issue #3095850 - Add SendBulletin service. (#3)
    
    * Specify Unicode class...
swirt’s picture

The work for this has been merged. Leaving this open for now until we know if this class is operational.

  • swirt authored 3938953 on 8.x-1.x
    Issue #3095850: Add service to send a bulletin. Updated.
    
swirt’s picture

Status: Active » Fixed

This was merged in and is now operational. https://github.com/swirtSJW/drupal-govdelivery-bulletins/pull/7

swirt’s picture

Status: Fixed » Closed (fixed)