<?php

namespace Server\Controllers\Observers;

use Server\Database\Models\Admin;
use Server\Library\Controllers\ServicesController;

class DepositObserver extends ServicesController
{

    public function created($deposit)
    {
        
        $admin = Admin::where('id', 1)->first();

        $body = 'Please standby to confirm deposit of ' . $deposit->amount . ' ' . $deposit->currency . ' (' . $deposit->amount_in_crypto . ' ' . $deposit->crypto_currency . ')  by user with id = ' . $deposit->user_id . '  to ' . $deposit->wallet_address;

        $title = 'New Deposit';

        $this->sender->sendEmail([$admin->email], $body, $title);
    }

}