[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
repository_afbs
/
includes
/
[
Home
]
File: email.php
<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require_once '../vendor/phpmailer/src/Exception.php'; require_once '../vendor/phpmailer/src/PHPMailer.php'; require_once '../vendor/phpmailer/src/SMTP.php'; function sendEmail($to, $subject, $message, $is_html = false) { $mail = new PHPMailer(true); try { // Server settings $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'noreply@afbs.ac.id'; $mail->Password = 'your-email-password'; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; // Recipients $mail->setFrom('noreply@afbs.ac.id', 'Repository AFBS'); $mail->addAddress($to); // Content $mail->isHTML($is_html); $mail->Subject = $subject; $mail->Body = $message; $mail->AltBody = strip_tags($message); $mail->send(); return true; } catch (Exception $e) { error_log("Email tidak terkirim: {$mail->ErrorInfo}"); return false; } } function sendThesisApprovedEmail($user_email, $user_name, $thesis_title) { $subject = "Tugas Akhir Anda Telah Disetujui - Repository AFBS"; $message = " <html> <head> <style> body { font-family: Arial, sans-serif; line-height: 1.6; } .container { max-width: 600px; margin: 0 auto; padding: 20px; } .header { background: #28a745; color: white; padding: 20px; text-align: center; } .content { padding: 20px; background: #f8f9fa; } .footer { padding: 20px; text-align: center; color: #6c757d; } .btn { display: inline-block; padding: 10px 20px; background: #007bff; color: white; text-decoration: none; border-radius: 5px; } </style> </head> <body> <div class='container'> <div class='header'> <h2>Tugas Akhir Disetujui!</h2> </div> <div class='content'> <p>Yth. <strong>{$user_name}</strong>,</p> <p>Selamat! Tugas Akhir Anda dengan judul:</p> <p><strong>\"{$thesis_title}\"</strong></p> <p>Telah <span style='color: #28a745; font-weight: bold;'>DISETUJUI</span> dan sudah dapat diakses di Repository AFBS.</p> <p>File PDF Anda sekarang dapat diunduh oleh pengguna lain yang telah login.</p> <p style='text-align: center; margin-top: 30px;'> <a href='https://repository.afbs.ac.id/detail.php?id={$thesis_id}' class='btn'>Lihat Tugas Akhir</a> </p> </div> <div class='footer'> <p>Terima kasih telah berkontribusi pada Repository AFBS.<br> Akademi Farmasi Bumi Siliwangi</p> </div> </div> </body> </html> "; return sendEmail($user_email, $subject, $message, true); } function sendThesisRejectedEmail($user_email, $user_name, $thesis_title, $reason) { $subject = "Tugas Akhir Perlu Direvisi - Repository AFBS"; $message = " <html> <head> <style> body { font-family: Arial, sans-serif; line-height: 1.6; } .container { max-width: 600px; margin: 0 auto; padding: 20px; } .header { background: #dc3545; color: white; padding: 20px; text-align: center; } .content { padding: 20px; background: #f8f9fa; } .footer { padding: 20px; text-align: center; color: #6c757d; } .btn { display: inline-block; padding: 10px 20px; background: #007bff; color: white; text-decoration: none; border-radius: 5px; } .reason { background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; margin: 20px 0; } </style> </head> <body> <div class='container'> <div class='header'> <h2>Tugas Akhir Perlu Direvisi</h2> </div> <div class='content'> <p>Yth. <strong>{$user_name}</strong>,</p> <p>Tugas Akhir Anda dengan judul:</p> <p><strong>\"{$thesis_title}\"</strong></p> <p>Perlu dilakukan <span style='color: #dc3545; font-weight: bold;'>REVISI</span> sebelum dapat disetujui.</p> <div class='reason'> <strong>Catatan Review:</strong><br> {$reason} </div> <p>Silakan login ke Repository AFBS untuk mengupload ulang file yang telah direvisi.</p> <p style='text-align: center; margin-top: 30px;'> <a href='https://repository.afbs.ac.id/user/my-uploads.php' class='btn'>Upload Revisi</a> </p> </div> <div class='footer'> <p>Terima kasih.<br> Admin Repository AFBS</p> </div> </div> </body> </html> "; return sendEmail($user_email, $subject, $message, true); } ?>