You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
498 B
PHTML
27 lines
498 B
PHTML
4 years ago
|
<?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;
|
||
|
}
|
||
|
}
|