<?php

// Track when an order has been placed so we can log it.
HooksAdapter::add_action('Order/markPaid', 'Mtc\Modules\BasketRecovery\Classes\BasketRecoveryLog::trackOrder');
HooksAdapter::add_action(
    'Order/markPaid',
    'Mtc\Modules\BasketRecovery\Classes\BasketRecoverySentEmails::orderMarkPaid',
);

if (filter_input(INPUT_GET, 'fup_id')) {
    // Insert a record in the log that this has been clicked on
    \Mtc\Modules\BasketRecovery\Classes\BasketRecoveryLog::query()->create([
        'basket_recovery_id' => filter_input(INPUT_GET, 'fup_id'),
        'action' => 'click',
        'value' => null,
    ]);
}
