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.
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:
- Install the module with
composer require drupal/cap_alerts - Enable the
cap_alertsmodule via the UI or withdrush pm:enable -y cap_alerts. - Visit
Configuration>Web Services>CAP Alertsto 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! - Create at least one Event term under
Structure>Taxonomy>CAP Alert - Events; OR - Import the standard top-level CAP Event terms then remove those unrelated to your agency (requires the Migrate module to be enabled):
- Import the 'Event terms' migration with
drush config:import --partial --source=/modules/contrib/cap_alerts/config/optional, then - Running the migration via
drush migrate:import cap_std_terms_event_code_migrationthen deleting any terms you don't need via the UI.
- Import the 'Event terms' migration with
- Publish your first CAP Alert by going to
Content>Add content>CAP Alert Message. - Visit
Content>CAP Alertsto 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:
- Background: https://www.undrr.org/early-warnings-for-all/common-alerting-protocol
- Specification: https://docs.oasis-open.org/emergency/cap/v1.2/CAP-v1.2-os.html.
- The 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. 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.
| Attachment | Size |
|---|---|
| CAP-Logo-L.png | 42.41 KB |
| The main admin interface | 177.45 KB |
| The settings form | 243.67 KB |
| More options in the settings form | 132.1 KB |
| CAP alert output as XML | 370.9 KB |
| CAP alert output as an RSS feed | 521.66 KB |
| CAP alert output as a Test Atom feed | 410.79 KB |
Project information
- Project categories: Decoupled, Developer tools, Integrations
- Ecosystem: Emergency Alerts, Emergency Notification
2 sites report using this module
- Created by timfletcher on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Atom/RSS improvements, circle radius validation and coordinate order warning






