Skip to content

Commit 058e09b

Browse files
MC-18193: All Sales emails are being copied to the same customer when sales_emails cron has an error
1 parent ce69707 commit 058e09b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,13 @@ public function setTemplateOptions($templateOptions)
261261
*/
262262
public function getTransport()
263263
{
264-
$this->prepareMessage();
265-
$mailTransport = $this->mailTransportFactory->create(['message' => clone $this->message]);
264+
try {
265+
$this->prepareMessage();
266+
$mailTransport = $this->mailTransportFactory->create(['message' => clone $this->message]);
267+
} catch (LocalizedException $e) {
268+
$this->reset();
269+
throw $e;
270+
}
266271
$this->reset();
267272

268273
return $mailTransport;

0 commit comments

Comments
 (0)