I am using the Content Moderation and the Workflows modules along with the Workbench Email module to generate email templates. The Workbench Email module uses tokens to create dynamic email templates. We have a requirement to provide the URL of the latest revision inside the email body to the reviewer, to make accessing the latest revision easier.
If I create a node that needs moderation, the /node/NID/latest page doesn’t exist; the reviewers will need a link to /node/NID.
When the content is already published and gets edited, the link in the email should be /node/NID/latest. If we just provide /node/NID in the URL, it won’t show the the latest revision.
Since we can have only one template to handle both of the above conditions, I was looking for a token which could provide me either /node/NID or /node/NID/latest based on whether the content is new or already published.
How can I achieve this?
I am using Drupal 9.1.5.