-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Fixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Duplicate of #4320 but since no activity there I created a new one with more detailed information.
Preconditions
- Magento v2.1.9
- PHP v7.0.14
- MySQL v5.6.33
Steps to reproduce
- Enable async email sending.
- Place an order via the website.
- Create a shipment using the API with
"appendComment": true
.
Expected result
- Shipment email is being send with comment appended.
Actual result
- Shipment email is being send without comment appended.
API call used
<domain>/rest/all/V1/order/1/ship
{
"items": [{
"order_item_id": 1,
"qty": 1
}],
"notify": true,
"appendComment": true,
"comment": {
"comment": "You order will be delivered between 12.00 and 14.00.",
"is_visible_on_front": 1
}
}
Workaround
This workaround will use the first comment found with getIsCustomerNotified
which is enough for our use case.
Create an after plugin for the \Magento\Sales\Model\Order\ShipmentDocumentFactory::create
public function afterCreate(ShipmentDocumentFactory $subject, ShipmentInterface $shipment)
{
foreach ($shipment->getComments() as $comment) {
/** @var ShipmentCommentInterface $comment */
if ($comment->getIsCustomerNotified()) {
$shipment->setCustomerNote($comment->getComment());
$shipment->setCustomerNoteNotify(true);
break;
}
}
return $shipment;
}
Metadata
Metadata
Assignees
Labels
Fixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release