Add useful twig variables to README

Created on 1 May 2025, 13 days ago

Problem/Motivation

When i was configuring my project to handle CM Notifications, i needed to provide a dynamic email sender.
To do so, i had to find the right twig variables to achieve my goal.

Proposed resolution

Add the table below into readme in order to help other users to easily find those most useful tokens

USEFUL TWIG VARIABLES
---------------------

The most commonly used Twig variables for notifications are:

Current User Email:                       {{ user.email }}
Current User Username (the login name):   {{ user.username }}
Current User DisplayName:                 {{ user.displayname }}
Current User ID (uid):                    {{ user.id }}

Author Email:                             {{ entity.Owner.mail.0.value }}
Author Username (the login name):         {{ entity.Owner.username }}
Author DisplayName:                       {{ entity.Owner.displayname }}
Author id (uid):                          {{ entity.Owner.id }}

Entity Title:                             {{ entity.title.value }}
Entity Bundle (Content type system name): {{ entity.bundle }}
Entity Bundle Label (Content type name):  {{ entity.type.entity.label }}
Entity ID:                                {{ entity.nid.value }}
Entity Revision:                          {{ entity.vid.value }}
Entity UUID:                              {{ entity.uuid.value }}
Feature request
Status

Active

Version

3.7

Component

Documentation

Created by

🇧🇷Brazil igorgoncalves

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024