I am trying to programmatically create the shipment and I succeeded in this operation. To do this I create a new CLI Command which I obviously run by command line.

I have only 1 storeview and the default locale is Italian.

The problem is about sending the email to the customer because it is always sent in English.

I try different ways to send the shipment email and the last is using the class


in this way


after had set


I also tried the class


in this way


I also try to embed the code inside a statement of EnvironmentEmulation using


using the following code


// send shipping confirmation e-mail to customer


I don't know if this is a bug, as many others I found or if I'm wrong.

Note: if I create and send the shipment from the backend the email is in the correct language.


I try executing the code by external php script using ObjectManager with the following code:

use Magento\Framework\App\Bootstrap;

require __DIR__ . '/../app/bootstrap.php';

$params = $_SERVER;

$bootstrap = Bootstrap::create(BP, $params);

$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');

$orderId = "000000009";

$order = $obj->get('Magento\Sales\Model\OrderRepository')->get($orderId);

$notifier = $obj->get('Magento\Sales\Model\Order\Shipment\NotifierInterface');

foreach($order->getShipmentsCollection() as $ship) {




...but I get the same result: the shipment email is sent in English and not Italian.

Please, help me!

Thank you.

  • Same problem here. Have you been able to fix it in the meantime? Sep 23, 2020 at 10:40

1 Answer 1


Looks like this was a bug in Magento prior to version 2.3.3-p1 and has been fixed since: https://github.com/magento/magento2/issues/23333

Apparently in this commit PR :https://github.com/magento/magento2/pull/23338

Even though the PR was merged in June 2019, Magento 2.3.3-p1 was only released in January 2020.

Not the answer you're looking for? Browse other questions tagged or ask your own question.