Common Alerting Protocol (CAP) safety alerts
The CAP standard is used worldwide to communicate consistent, timely safety information in a way that many applications and devices can consume.
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 to Drupal content types, fields and taxonomy, so that publishers can fully utilize the functionality of the CAP standard entirely from within Drupal.
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.
The CAP standard supports XML, RSS, Atom and EDXL-DE feed formats. This module currently only provides the XML feed format, but support for the other formats is planned.
It allows information to be distributed and consumed by a wide variety of systems, including emergency alerting systems, SMS, emails, pagers, weather alerting systems, digital road signs and more.
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.
Understanding the CAP standard
It is strongly advised to read the CAP documentation before using this module:
https://docs.oasis-open.org/emergency/cap/v1.2/CAP-v1.2-os.html
Official home of the CAP standard: https://cap.alert-hub.org/
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.
Never publish alerts for domains you are not authorised to publish in! Doing so can result in confusion, delay, conflicting information and potentially serious and even deadly consequences for the public. If you are unsure, please contact your local emergency services or relevant authority before publishing any alerts.
It is the responsibility of the publisher to ensure they are authorised to publish their alerts.
Installation
- Install the module with `composer require drupal/cap_alerts`
- Enable the `cap_alerts` module via the UI or with `drush pm:enable -y cap_alerts`.
- Install and enable the `migrate`, `migrate_plus`, and `migrate_tools` modules if not already installed. These are required to import the CAP-controlled terms and can be removed once done.
- Run `drush migrate:import --group="cap_terms" -y` to import the cap-controlled terms.
- Visit `/admin/config/services/cap-alerts` to configure your CAP feed settings. You MUST do this before any of your alerts are consumed by external services, as these settings change the output of the CAP feed!.
- Publish your first CAP Alert by going to `Content` > `Add content` > `CAP Alert Message`.
- Visit `/api/alerts` to view your CAP feed, or `/api/alerts/test` to view the test feed (requires 'Access CAP alerts test feed' permission or the Administrator role).
The module will create several new entity types:
- Content Type: `CAP Alert Message`
- Paragraph types: `CAP Alert - *`
- Taxonomy Vocabularies: `CAP Alert - *`.
Do NOT change the terms in the CAP taxonomy vocabularies, as they are controlled by the CAP standard and may be updated in future releases of this module. Using any terms other than what is included will result in your alerts being non-compliant with the CAP standard and potentially rejected by consuming systems! (They shouldn't be, but they might).
More information
See the README.md file for more information.