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 }}Issue fork content_moderation_notifications-3522215
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
igorgoncalves commentedComment #3
danrodComment #5
danrodI created a MR to add this table.
I suggest to replace the README.txt with a README.md and follow the template guidelines: https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or...
but this is out of scope of this issue, I'll create another issue to address that.
Comment #6
danrodComment #7
igorgoncalves commentedThanks danrod!
Looks good to me.
Comment #8
igorgoncalves commentedComment #10
bkosborneThanks all. Some of those twig vars are incorrect though. I updated them before committing.