CustomVaribleInEmailTemplate
Magento 2 Custom Variable In Email Template
Run the following commands :
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
How to use varible in email template ?
As per Our observer defined You can use
{{trans 'User Id : '}}{{var userId}}
Supports : Magento 2.0.x, 2.1.x, 2.2.x, 2.3.x and 2.4.x