save
This commit is contained in:
parent
9b15ac9fd3
commit
27df1a73b5
28 changed files with 1695 additions and 247 deletions
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
namespace app;
|
||||
// for email
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
@ -7,6 +8,7 @@ use PHPMailer\PHPMailer\Exception;
|
|||
class app
|
||||
{
|
||||
public static $db;
|
||||
|
||||
public static function init_db()
|
||||
{
|
||||
try {
|
||||
|
@ -16,6 +18,7 @@ class app
|
|||
die("Database error: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static function send_mail($to, $from, $from_name, $subject, $message, $HTML_message)
|
||||
{
|
||||
$mail = new PHPMailer(exceptions: true);
|
||||
|
@ -40,6 +43,7 @@ class app
|
|||
$mail->send();
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
public static function sendJson($data, $status = 200)
|
||||
{
|
||||
http_response_code($status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue