fipamo/brain/api/v1/MailerAPI.inc.php
2021-05-06 12:45:39 -07:00

27 lines
498 B
PHP

<?php
class MailerAPI
{
public function __construct()
{
}
public static function handleMail($request, $body, $response)
{
//if testing, verify session is active
if ($body["mail_task"] == "TESTING") {
if (Session::active()) {
$result = Mailer::sendmail($body);
} else {
$result = [
"message" => "You need to be logged in for this, champ.",
"type" => "MAILER_ERROR",
];
}
} else {
}
return $result;
}
}