mirror of
https://github.com/itflow-org/itflow
synced 2026-08-05 07:07:14 +00:00
Clear mail bodies after successful delivery
This commit is contained in:
@@ -65,7 +65,9 @@ ob_start();
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<div class="prettyContent">
|
||||
<?php echo $email_content; ?>
|
||||
<?php if ($email_status == 3 && $email_content === '') { ?>
|
||||
<em class="text-secondary">Message content was cleared on delivery.</em>
|
||||
<?php } else { echo $email_content; } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,14 @@ if (isset($_GET['send_failed_mail'])) {
|
||||
|
||||
$email_id = intval($_GET['send_failed_mail']);
|
||||
|
||||
// Delivered mail has had its body cleared on send, so resending would deliver an empty message
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT email_status FROM email_queue WHERE email_id = $email_id LIMIT 1"));
|
||||
|
||||
if (!$row || intval($row['email_status']) === 3) {
|
||||
flashAlert("That email has already been delivered and cannot be resent.", 'error');
|
||||
redirect();
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"UPDATE email_queue SET email_status = 0, email_attempts = 3 WHERE email_id = $email_id");
|
||||
|
||||
logAudit("Email", "Send", "$session_name attempted to force send email id: $email_id in the mail queue", 0, $email_id);
|
||||
|
||||
@@ -70,8 +70,14 @@ if (isset($_POST['add_user'])) {
|
||||
|
||||
$password = mysqli_real_escape_string($mysqli, $_POST['password']);
|
||||
|
||||
// Only hand out the login key when the gate is actually enabled - same test as post/logout.php
|
||||
$login_url = "https://$config_base_url/login.php";
|
||||
if ($config_login_key_required == 1) {
|
||||
$login_url .= "?key=$config_login_key_secret";
|
||||
}
|
||||
|
||||
$subject = "Your new $company_name ITFlow account";
|
||||
$body = "Hello $name,<br><br>An ITFlow account has been setup for you. Please change your password upon login. <br><br>Username: $email <br>Password: $password<br>Login URL: https://$config_base_url/login.php?key=$config_login_key_secret<br><br>--<br>$company_name - Support<br>$config_ticket_from_email";
|
||||
$body = "Hello $name,<br><br>An ITFlow account has been setup for you. Please change your password upon login. <br><br>Username: $email <br>Password: $password<br>Login URL: $login_url<br><br>--<br>$company_name - Support<br>$config_ticket_from_email";
|
||||
|
||||
$data = [
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user