$mailModel =
$this->modelManager->
getRepository(Mail::
class)->
findOneBy( ['name' =>
$templateName] );
if (!
$mailModel instanceof Mail
) { return null;
} $order =
$this->
getOrderForStatusMail($orderId);
$orderDetails =
$this->
getOrderDetailsForStatusMail($orderId);
$dispatch = null;
if (!
empty($order['dispatchID'
])) { $dispatch =
$this->db->
fetchRow('
SELECT id, name, description FROM s_premium_dispatch
WHERE id=?
',
[$order['dispatchID'
]]);
} $user =
$this->
getCustomerInformationByOrderId($orderId);