2021-04-30 23:55:23 +02:00
|
|
|
<?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 {
|
|
|
|
}
|
2021-04-30 23:55:23 +02:00
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|