Common Alerting Protocol (CAP) safety alerts
This module allows a Drupal website to publish emergency alerts using the CAP standard (v1.2). It maps CAP functionality to Drupal content types and fields, enabling users to create and manage alerts directly within Drupal for distribution to various systems like emergency alerting platforms and digital signage.
The CAP standard is used worldwide to communicate consistent, timely safety information in a way that many applications and devices can consume. 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.
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 utilize 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 RSS, Atom and an XML feed format, and support for EDXL-DE is being investigated.
Differences between 1.0.x and 2.0.x releases
2.0.x release is a major rewrite of 1.0.x, and is not backwards compatible. It adds the following new features:
- Aligns with the requirements of many Listed CAP Alert Hubs, including Google Public Alerts and WMO Alert Hub.
- Alerts can now be easily cloned to create Update and Cancellation alerts, with the correct references chain automatically populated.
- Alerts are now available indefinitely via their canonical URL, even after they have expired. This allows for auditability and historical reference.
- RSS and Atom feed formats, in addition to the existing XML feed format.
- Full Alert cancellation chain support - expired or cancelled alerts are culled from the RSS/Atom feeds automatically.
- API key access to the Test feed endpoints.
- Cleaner uninstall behaviour.
The original XML feed functionality from 1.0.x has been deprecated in 2.0.x, and will be removed in a future release. It is recommended that all consuming services migrate to the new RSS or Atom feed endpoints.
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.
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`.
- 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!.
- Create at least one Event term under `Structure` > `Taxonomy` > `CAP Alert - Events`.
- Optional: As a starting point, you can import the standard top-level CAP
Event terms by:- Importing 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_migration`, then deleting any terms you don't need via the UI.
- Publish your first CAP Alert by going to `Content` > `Add content` > `CAP Alert Message`.
- Visit `/admin/content/cap_alerts` to view your alerts and access the feed links.
The module will create several new entity types:
- Content Type: `CAP Alert Message`
- Paragraph types: `CAP Alert - *`
- Taxonomy Vocabularies: `CAP Alert - *`.
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.
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.
More information
See the README.md file for more information.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.1.0-alpha1 | Pre-release | 11 | Cloning Alerts for rapidly generating Update and Cancellation Alerts with automated referencing | Aug 28, 2026 | |
| 2.0.0-alpha1 | Pre-release | 11 | Major update, RSS/Atom feeds, Cancellation chain and Google Public Alerts alignment | Aug 25, 2026 | |
| 1.0.0-alpha1 | Pre-release | 11 | Alpha release | Jul 24, 2026 |