<?php

$path = '../../../';
require_once $path.'core/includes/header.inc.php';

use Illuminate\Database\Capsule\Manager as Capsule;
use Mtc\Modules\BasketRecovery\Classes\BasketRecovery;
use Mtc\Modules\BasketRecovery\Classes\BasketRecoveryEmail;

$item = BasketRecovery::find($_REQUEST['id']);
$basket_id = Capsule::table('basket_items')->orderBy('id', 'DESC')->pluck('basket_id');

if ($basket_id > 0) {
    $basket = new Basket($basket_id);
    $basket->Go_Basket();

    echo BasketRecoveryEmail::generateEmailForBasketId($basket_id, $item, [], $twig);
} else {
    echo "Missing basket id.";
}
