$shop =
$orderModel->
getLanguageSubShop();
} $this->
get(ShopRegistrationServiceInterface::
class)->
registerShop($shop);
// Try to send the actual mail
try { $mail =
Shopware()->
TemplateMail()->
createMail($template,
$context,
$shop);
$mail->
addTo($mailTo);
if ($orderModel !== null
) { $mail->
setAssociation(LogEntryBuilder::ORDER_ASSOCIATION,
$orderModel);
} else { $mail->
setAssociation(LogEntryBuilder::ORDER_ID_ASSOCIATION,
$orderId);
} $mail->
send();
} catch (Exception
$e) { $this->
View()->
assign(['success' => false, 'message' =>
$e->
getMessage()]);
return;
}