Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions app/code/Magento/Sales/Model/Order/Email/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public function __construct(
}

/**
* Send order email if it is enabled in configuration.
*
* @param Order $order
* @return bool
*/
Expand All @@ -81,17 +83,21 @@ protected function checkAndSend(Order $order)

try {
$sender->send();
$sender->sendCopyTo();
} catch (\Exception $e) {
$this->logger->error($e->getMessage());

return false;
}

try {
$sender->sendCopyTo();
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
}
return true;
}

/**
* Populate order email template with customer information.
*
* @param Order $order
* @return void
*/
Expand All @@ -113,6 +119,8 @@ protected function prepareTemplate(Order $order)
}

/**
* Create Sender object using appropriate template and identity.
*
* @return Sender
*/
protected function getSender()
Expand All @@ -126,6 +134,8 @@ protected function getSender()
}

/**
* Get template options.
*
* @return array
*/
protected function getTemplateOptions()
Expand All @@ -137,6 +147,8 @@ protected function getTemplateOptions()
}

/**
* Render shipping address into html.
*
* @param Order $order
* @return string|null
*/
Expand All @@ -148,6 +160,8 @@ protected function getFormattedShippingAddress($order)
}

/**
* Render billing address into html.
*
* @param Order $order
* @return string|null
*/
Expand Down