Description
Preconditions and environment
- Magento version
2.4.7-p5 - Multi-store setup with different configurations for shipment emails
- Default store has shipment emails disabled
- Secondary store has shipment emails enabled
Steps to reproduce
- Set up a multi-store configuration where the default store has shipment emails disabled
- Create an order in a secondary store that has shipment emails enabled
- Go to Admin > Sales > Orders
- Open the order from the secondary store
- Click on "Ship" button
- Fill in shipment details and check "Email Copy of Shipment"
- Submit the shipment
Expected result
The system should send a shipment confirmation email as it is enabled in the store configuration where the order was placed.
Actual result
No shipment confirmation email is sent because the system checks the default store configuration instead of the store configuration where the order was placed.
Additional information
Root cause analysis
In Save.php at line 170, the shipment email sending condition is checked using:
if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail())
The canSendNewShipmentEmail()
method is called without passing the store ID parameter. This causes the system to check the configuration of the default store instead of the store where the order was placed.
The correct implementation should pass the order's store ID to this method:
if (!empty($data['send_email']) && $this->salesData->canSendNewShipmentEmail($shipment->getOrder()->getStoreId()))
This issue affects multi-store setups where different stores have different email configuration settings.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status