Skip to content

Commit 240805e

Browse files
ENGCOM-8087: Add missing order_data array to EmailSender classes #27454
2 parents f424990 + 1c173ab commit 240805e

File tree

6 files changed

+52
-1
lines changed

6 files changed

+52
-1
lines changed

app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public function send(
111111
'store' => $order->getStore(),
112112
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
113113
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
114+
'order_data' => [
115+
'customer_name' => $order->getCustomerName(),
116+
'is_not_virtual' => $order->getIsNotVirtual(),
117+
'email_customer_note' => $order->getEmailCustomerNote(),
118+
'frontend_status_label' => $order->getFrontendStatusLabel()
119+
]
114120
];
115121
$transportObject = new DataObject($transport);
116122

app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public function send(
111111
'store' => $order->getStore(),
112112
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
113113
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
114+
'order_data' => [
115+
'customer_name' => $order->getCustomerName(),
116+
'is_not_virtual' => $order->getIsNotVirtual(),
117+
'email_customer_note' => $order->getEmailCustomerNote(),
118+
'frontend_status_label' => $order->getFrontendStatusLabel()
119+
]
114120
];
115121
$transportObject = new DataObject($transport);
116122

app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ public function send(
112112
'payment_html' => $this->getPaymentHtml($order),
113113
'store' => $order->getStore(),
114114
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
115-
'formattedBillingAddress' => $this->getFormattedBillingAddress($order)
115+
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
116+
'order_data' => [
117+
'customer_name' => $order->getCustomerName(),
118+
'is_not_virtual' => $order->getIsNotVirtual(),
119+
'email_customer_note' => $order->getEmailCustomerNote(),
120+
'frontend_status_label' => $order->getFrontendStatusLabel()
121+
]
116122
];
117123
$transportObject = new DataObject($transport);
118124

app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
273273
->method('setSendEmail')
274274
->with($emailSendingResult);
275275

276+
$this->orderMock->method('getCustomerName')->willReturn('Customer name');
277+
$this->orderMock->method('getIsNotVirtual')->willReturn(true);
278+
$this->orderMock->method('getEmailCustomerNote')->willReturn(null);
279+
$this->orderMock->method('getFrontendStatusLabel')->willReturn('Pending');
280+
276281
if (!$configValue || $forceSyncMode) {
277282
$transport = [
278283
'order' => $this->orderMock,
@@ -283,6 +288,12 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
283288
'store' => $this->storeMock,
284289
'formattedShippingAddress' => 'Formatted address',
285290
'formattedBillingAddress' => 'Formatted address',
291+
'order_data' => [
292+
'customer_name' => 'Customer name',
293+
'is_not_virtual' => true,
294+
'email_customer_note' => null,
295+
'frontend_status_label' => 'Pending',
296+
],
286297
];
287298
$transport = new DataObject($transport);
288299

app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
272272
->method('setSendEmail')
273273
->with($emailSendingResult);
274274

275+
$this->orderMock->method('getCustomerName')->willReturn('Customer name');
276+
$this->orderMock->method('getIsNotVirtual')->willReturn(true);
277+
$this->orderMock->method('getEmailCustomerNote')->willReturn(null);
278+
$this->orderMock->method('getFrontendStatusLabel')->willReturn('Pending');
279+
275280
if (!$configValue || $forceSyncMode) {
276281
$transport = [
277282
'order' => $this->orderMock,
@@ -282,6 +287,12 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
282287
'store' => $this->storeMock,
283288
'formattedShippingAddress' => 'Formatted address',
284289
'formattedBillingAddress' => 'Formatted address',
290+
'order_data' => [
291+
'customer_name' => 'Customer name',
292+
'is_not_virtual' => true,
293+
'email_customer_note' => null,
294+
'frontend_status_label' => 'Pending',
295+
],
285296
];
286297
$transport = new DataObject($transport);
287298

app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
284284
->method('setSendEmail')
285285
->with($emailSendingResult);
286286

287+
$this->orderMock->method('getCustomerName')->willReturn('Customer name');
288+
$this->orderMock->method('getIsNotVirtual')->willReturn(true);
289+
$this->orderMock->method('getEmailCustomerNote')->willReturn(null);
290+
$this->orderMock->method('getFrontendStatusLabel')->willReturn('Pending');
291+
287292
if (!$configValue || $forceSyncMode) {
288293
$transport = [
289294
'order' => $this->orderMock,
@@ -296,6 +301,12 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
296301
'store' => $this->storeMock,
297302
'formattedShippingAddress' => 'Formatted address',
298303
'formattedBillingAddress' => 'Formatted address',
304+
'order_data' => [
305+
'customer_name' => 'Customer name',
306+
'is_not_virtual' => true,
307+
'email_customer_note' => null,
308+
'frontend_status_label' => 'Pending',
309+
],
299310
];
300311
$transport = new DataObject($transport);
301312

0 commit comments

Comments
 (0)