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

Extends the Push Framework module with a content-aware templating system for push notifications. Where Push Framework handles delivery across channels (email, SMS, web push, etc.), this module lets you control what the notifications actually say based on the content that triggered them.

Requirements

Configuration

Templates are managed at Administration > Configuration > Push Framework Templates (/admin/config/push-framework-templates).

Creating a template

Each template has:

  • Title: A human-readable name for the admin list.
  • Event key: The lookup key that determines when this template is used (see below).
  • Subject and Body: The notification text, with support for tokens.
  • Per-channel overrides: Optional subject and body for specific delivery channels (email, SMS, etc.). If no override is set for the active channel, the default subject and body are used.

Event keys and template resolution

The event key defines how specific a template is. When a notification is dispatched, the module tries to find a matching template in this order, using the first match it finds:

  1. {entity_type}__{bundle}__{topic} (most specific)
  2. {entity_type}__{topic}
  3. {topic} (least specific, catch-all)

For example, when a new article node is created, the lookup order is:

  1. node__article__create
  2. node__create
  3. create

This means a generic create template acts as a fallback for all content types unless a more specific one is defined.

Supported tokens

Templates support standard Drupal tokens as well as the following tokens provided by this module:

Token Description
[user:display-name] The notification recipient's display name
[push-object:label] The entity label (title)
[push-object:type-label] The human-readable bundle name
[push-object:author] The display name of the entity author
[push-object:url] The canonical URL of the entity
[push-object:parent-label] The parent entity label (for comments)
[push-object:parent-url] The parent entity URL (for comments)
[site:name] The site name

If the Token module is installed, a token browser is available directly in the template form.

Per-channel overrides

Some channels have different formatting requirements. A push notification to a mobile device may need a much shorter subject than an email, for example. Each template can have a separate subject and body per channel. The override section in the form lists all currently enabled channel plugins and lets you opt in to a custom text for each one.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • Created by n1k on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases