mirror of https://github.com/itflow-org/itflow
Update Mail Send Test to use the proper from name when sending a test also show the from name from the select
This commit is contained in:
parent
e07fb9ce50
commit
9bd28b1c56
|
|
@ -151,7 +151,22 @@ if (isset($_POST['test_email_smtp'])) {
|
|||
|
||||
validateCSRFToken($_POST['csrf_token']);
|
||||
validateAdminRole();
|
||||
$email_from = sanitizeInput($_POST['email_from']);
|
||||
|
||||
$test_email = intval($_POST['test_email']);
|
||||
if($test_email == 1) {
|
||||
$email_from = sanitizeInput($config_mail_from_email);
|
||||
$email_from_name = sanitizeInput($config_mail_from_name);
|
||||
} elseif ($test_email == 2) {
|
||||
$email_from = sanitizeInput($config_invoice_from_email);
|
||||
$email_from_name = sanitizeInput($config_invoice_from_name);
|
||||
} elseif ($test_email == 3) {
|
||||
$email_from = sanitizeInput($config_quote_from_email);
|
||||
$email_from_name = sanitizeInput($config_quote_from_name);
|
||||
} else {
|
||||
$email_from = sanitizeInput($config_ticket_from_email);
|
||||
$email_from_name = sanitizeInput($config_ticket_from_name);
|
||||
}
|
||||
|
||||
$email_to = sanitizeInput($_POST['email_to']);
|
||||
$subject = "Test email from ITFlow";
|
||||
$body = "This is a test email from ITFlow. If you are reading this, it worked!";
|
||||
|
|
@ -159,7 +174,7 @@ if (isset($_POST['test_email_smtp'])) {
|
|||
$data = [
|
||||
[
|
||||
'from' => $email_from,
|
||||
'from_name' => $email_from,
|
||||
'from_name' => $email_from_name,
|
||||
'recipient' => $email_to,
|
||||
'recipient_name' => 'Chap',
|
||||
'subject' => $subject,
|
||||
|
|
|
|||
|
|
@ -269,31 +269,33 @@ require_once "inc_all_settings.php";
|
|||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="input-group">
|
||||
<select class="form-control select2" name="email_from" required>
|
||||
<select class="form-control select2" name="test_email" required>
|
||||
<option value="">- Select an Email Address to send from -</option>
|
||||
<?php
|
||||
if(!empty($config_mail_from_email)){
|
||||
if ($config_mail_from_email) {
|
||||
?>
|
||||
<option><?php echo nullable_htmlentities($config_mail_from_email); ?></option>
|
||||
<option value="1"><?php echo nullable_htmlentities($config_mail_from_name); ?> (<?php echo nullable_htmlentities($config_mail_from_email); ?>)</option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
if(!empty($config_ticket_from_email)){
|
||||
if ($config_invoice_from_email) {
|
||||
?>
|
||||
<option><?php echo nullable_htmlentities($config_ticket_from_email); ?></option>
|
||||
<option value="2"><?php echo nullable_htmlentities($config_invoice_from_name); ?> (<?php echo nullable_htmlentities($config_invoice_from_email); ?>)</option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
if(!empty($config_invoice_from_email)){
|
||||
if ($config_quote_from_email) {
|
||||
?>
|
||||
<option><?php echo nullable_htmlentities($config_invoice_from_email); ?></option>
|
||||
<option value="3"><?php echo nullable_htmlentities($config_quote_from_name); ?> (<?php echo nullable_htmlentities($config_quote_from_email); ?>)</option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
if(!empty($config_quote_from_email)){
|
||||
if ($config_ticket_from_email) {
|
||||
?>
|
||||
<option><?php echo nullable_htmlentities($config_quote_from_email); ?></option>
|
||||
<option value="4"><?php echo nullable_htmlentities($config_ticket_from_name); ?> (<?php echo nullable_htmlentities($config_ticket_from_email); ?>)</option>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</select>
|
||||
<input type="email" class="form-control " name="email_to" placeholder="Email address to send to">
|
||||
<div class="input-group-append">
|
||||
|
|
|
|||
Loading…
Reference in New Issue