<?php
include "../../src/config.php";

if (!isset($_GET["letter"])) {
    endrequest("Invalid request");
}

$letter = letters::get($_GET["letter"]);
if (!$letter) {
    endrequest("Invalid Letter ID");
} else {

    $response = maillogs::byletter($query, ["institution" => $_GET["institution"]]);
    echo json_encode($response);
}
