This project is not covered by Drupal’s security advisory policy.

Publish safety alerts that comply with the Common Alerting Protocol v1.2 (CAP standard), and serve them via CAP-compliant XML/RSS/Atom feeds.

CAP alerts dashboard
CAP alerts settings
CAP alerts settings 2
CAP alerts XML output
CAP alerts RSS output
CAP alerts test Atom output

The CAP standard is a messaging protocol used worldwide to communicate consistent, timely safety information in a way that many applications can consume. It allows information to be distributed from a single source of truth and be consumed by many consumers, including emergency alerting systems, SMS, emails, TV broadcasts, PA speakers, pagers, weather alerting systems, digital road signs and more.

This module allows a Drupal website to act as a CAP alert publisher (CAP v1.2 Message Producer). It does not provide the ability to consume/ingest CAP alerts from other sources (CAP v1.2 Message Consumer).

It aims to provide a 1:1 mapping of the CAP standard v1.2 to Drupal entities, so publishers can fully utilise the functionality of the CAP standard entirely from within Drupal without needing any technical knowledge. In particular, it aims to lower the barriers to entry for the distribution of safety information worldwide.

All alerts published by this module are treated as being CAP v1.2 compliant. No support for versions 1.0 and 1.1 is planned at this stage, but I'm open to feedback on if this would be useful.

This module currently provides feeds for XML, RSS and Atom, and support for EDXL-DE is being investigated.

Features

  • Aligns with the requirements of many Listed CAP Alert Hubs out of the box, including Google Public Alerts and WMO Alert Hub.
  • Keeps the incident history simple - Create 'Update' and 'Cancel' alerts from existing alerts, with the reference chain automatically populated.
  • Alerts are available indefinitely via their canonical URL, even after they have expired. This makes auditing easier and provides historical reference.
  • If multiple alerts apply to an incident, group alerts with the 'Incident' vocabulary.
  • Alerts are available in RSS, Atom and XML feed formats.
  • Cancellation chain support - expired or cancelled alerts are culled from the RSS/Atom feeds automatically.
  • Access to the Test feed endpoints can be handled via a custom API key.

See the README.md file for more information.

Installation

The module will create several new entity types:

  • Content Type: `CAP Alert Message`
  • Paragraph types: `CAP Alert - *`
  • Taxonomy Vocabularies: `CAP Alert - *`.

To install the module:

  1. Install the module with composer require drupal/cap_alerts
  2. Enable the cap_alerts module via the UI or with drush pm:enable -y cap_alerts.
  3. Visit Configuration > Web Services > CAP Alerts to configure your CAP feed settings. You should do this before any of your alerts are consumed by external services, as these settings change the output of the CAP feed!
  4. Create at least one Event term under Structure > Taxonomy > CAP Alert - Events; OR
  5. Import the standard top-level CAP Event terms then remove those unrelated to your agency (requires the Migrate module to be enabled):
    1. Import the 'Event terms' migration with drush config:import --partial --source=/modules/contrib/cap_alerts/config/optional, then
    2. Running the migration via
      drush migrate:import
       cap_std_terms_event_code_migration

      then deleting any terms you don't need via the UI.

  6. Publish your first CAP Alert by going to Content > Add content > CAP Alert Message.
  7. Visit Content > CAP Alerts to view your alerts and access the feed links.

Understanding the CAP standard

It is strongly advised to read the CAP documentation before using this module:

There are important restrictions to be aware of around what certain agencies may publish. This module cannot verify if the user has the necessary authority to publish certain types of alerts e.g. weather, law enforcement, emergency services etc. It is the responsibility of the publisher to ensure they are authorised to publish their alerts.

Remember, never publish alerts for domains in which you are not authorised to publish! Doing so can result in confusion, delay, conflicting information, panic and potentially serious and even deadly consequences for the public. Remember in 2018 when the people of Hawaii received an 'Incoming ballistic missile' alert by mistake?

If you are unsure, please contact your local emergency services or relevant authority before publishing any alerts.

AI Development Declaration

This module was written with the assistance of AI agents. The module maintainer reviews and takes full responsibility for all the work done by AI.

Want to help?

Check out the TODO file in the project source code for a list of outstanding tasks.

It would also be amazing to translate this content into as many languages as possible to maximise reach.

Project information

Releases