fipamo/brain/api/v1/MailerAPI.inc.php

27 lines
498 B
PHP
Raw Normal View History

<?php
class MailerAPI
{
public function __construct()
{
}
public static function handleMail($request, $body, $response)
{
2021-05-06 21:45:39 +02:00
//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;
}
}