Skip to content

Commit

Permalink
Update QAC_Send_Notification.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lechiluan committed Apr 16, 2023
1 parent 754d228 commit 813ed3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion QAC_Send_Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

if (isset($_GET['topic'])) {
$topic = $_GET['topic'];
//get topic name
$sql = "SELECT TopicName FROM Topic WHERE TopicID = '$topic'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$topicname = $row['TopicName'];
$department_id = $_SESSION['department_id'];
// Get all staff email addresses of my department
$sql = "SELECT Email FROM Staff WHERE DepartmentID = '$department_id'";
Expand Down Expand Up @@ -38,7 +43,7 @@
// Content
$mail->isHTML(true);
$mail->Subject = 'New idea has been submitted';
$mail->Body = "Dear staff,<br><br>There is a new idea has been submitted for $topic. at https://greenwichideas.cleverapps.io/. Please add more ideas to this topic to improve the quality of the topic.<br><br>Thank you.<br><br>Greenwich QA<br><br>";
$mail->Body = "Dear staff,<br><br>There is a new idea has been submitted for $topicname at https://greenwichideas.cleverapps.io/. Please add more ideas to this topic to improve the quality of the topic.<br><br>Thank you.<br><br>Greenwich QA<br><br>";
$mail->send();
echo "<script>alert('Email sent successfully.')</script>";
// Reload current page after sending email
Expand Down

0 comments on commit 813ed3c

Please sign in to comment.