User attributes in custom emails

How can I access and add information from users profile in the custom emails (forgot password, reset password…)sent from okta.
I’d like to include both default attributes and some custom attributes.
There is some related documentation here https://developer.okta.com/reference/okta_expression_language/index .

Example: I am trying to display users middle name using tag ${user.middleName} but I get the error Property ‘user.middleName’ not found.
However I can get the last name using ${user.lastName} correctly.

How can I access all user attributes in the email templates ?

https://support.okta.com/help/s/article/Custom-HTML-End-User-Templates

You can use the normal expression language assuming the profile editor schema has the mappings correctly configured. Is your middleName attribute defined and mapped?