I have created a custom attribute for customers. In the next step I want to access it in email templates. For example in the password forgotten template.
The variable "customer" contains the following information:
...
[email] => [email protected]
[firstname] => John
[lastname] => Doe
[prefix] => Mr.
[gender] => 0
[store_id] => 1
[website_id] => 1
[addresses] => Array
(
)
[disable_auto_group_change] => 0
[custom_attributes] => Array
(
[0] => Array
(
[attribute_code] => my_custom_attribute
[value] => 1234
)
)
[name] => John Doe
)
The only way that works is to use {{var customer.custom_attributes.0.value}}
. But this doesn't seem to be a reasonable way, because the array key "0" is not reliably the one of my_custom_attribute.
How can I access my_custom_attribute reliable?
side note: Creating a plugin for the EmailNotification::getFullCustomerData() method doesn't work either, because this method is private.