Skip to content

Commit 18f78d5

Browse files
author
Alexey Yakimovich
committed
MAGETWO-91725: Reward Points Balance Update Emails are not being sent when balance change initiated by store front
- Fixed an issue with incorrect work of 'Subscribe for Balance Updates' functionality;
1 parent 8fd89cf commit 18f78d5

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

app/code/Magento/Customer/Model/Metadata/CustomerMetadata.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(
4646
}
4747

4848
/**
49-
* {@inheritdoc}
49+
* @inheritdoc
5050
*/
5151
public function getAttributes($formCode)
5252
{
@@ -67,7 +67,7 @@ public function getAttributes($formCode)
6767
}
6868

6969
/**
70-
* {@inheritdoc}
70+
* @inheritdoc
7171
*/
7272
public function getAttributeMetadata($attributeCode)
7373
{
@@ -92,7 +92,7 @@ public function getAttributeMetadata($attributeCode)
9292
}
9393

9494
/**
95-
* {@inheritdoc}
95+
* @inheritdoc
9696
*/
9797
public function getAllAttributesMetadata()
9898
{
@@ -116,7 +116,7 @@ public function getAllAttributesMetadata()
116116
}
117117

118118
/**
119-
* {@inheritdoc}
119+
* @inheritdoc
120120
*/
121121
public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_INTERFACE_NAME)
122122
{
@@ -134,13 +134,27 @@ public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_IN
134134
$isDataObjectMethod = isset($this->customerDataObjectMethods['get' . $camelCaseKey])
135135
|| isset($this->customerDataObjectMethods['is' . $camelCaseKey]);
136136

137-
/** Even though disable_auto_group_change is system attribute, it should be available to the clients */
138137
if (!$isDataObjectMethod
139-
&& (!$attributeMetadata->isSystem() || $attributeCode == 'disable_auto_group_change')
138+
&& (!$attributeMetadata->isSystem()
139+
|| in_array($attributeCode, $this->getAllowedSystemAttributesList())
140+
)
140141
) {
141142
$customAttributes[] = $attributeMetadata;
142143
}
143144
}
144145
return $customAttributes;
145146
}
147+
148+
/**
149+
* Get list of system attributes which should be available to the clients
150+
*
151+
* @return array
152+
*/
153+
private function getAllowedSystemAttributesList()
154+
{
155+
return [
156+
'disable_auto_group_change',
157+
'reward_update_notification'
158+
];
159+
}
146160
}

0 commit comments

Comments
 (0)