'sVouchervalidto' =>
$code['validTo'
],
'sVouchervalidfrom' =>
$code['validFrom'
],
'sVoucherpercental' =>
$code['percental'
],
];
} // Find the shop matching the order
$orderModel =
$this->
get('models'
)->
find(Order::
class,
$orderId);
if (!
$orderModel instanceof Order
) { $shop =
$this->
get('models'
)->
getRepository(Shop::
class)->
getActiveDefault();
} else { $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);
}