Fax Server changes (#7136)
* Added the ability to send out successful and failed fax notifications to a separate list of email addresses (confirmation emails), in addition to the email address of the originator of the fax. * Added new fax_email_confirmation permission * Check the Session variable for the user's email first and if it is not set, then query the database for the currently logged-in user's email.
This commit is contained in:
+27
-2
@@ -673,9 +673,34 @@ if (!function_exists('fax_split_dtmf')) {
|
||||
$parameters['fax_uuid'] = $fax_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
$mail_to_address = $row["fax_email"];
|
||||
//$mail_to_address = $row["fax_email"];
|
||||
$fax_prefix = $row["fax_prefix"];
|
||||
unset($sql, $parameters, $row);
|
||||
unset($sql, $parameters);
|
||||
|
||||
//Get the currently logged in user's email
|
||||
if(isset($_SESSION["user_email"])) {
|
||||
$mail_to_address = $_SESSION["user_email"];
|
||||
} else {
|
||||
$sql = "select user_email from v_users where user_uuid = :user_uuid ";
|
||||
$parameters['user_uuid'] = $user_uuid;
|
||||
$database = new database;
|
||||
$user_settings = $database->select($sql, $parameters, 'row');
|
||||
|
||||
$mail_to_address = $user_settings["user_email"];
|
||||
unset($sql, $parameters, $user_settings);
|
||||
}
|
||||
|
||||
//Get a list of emails to send confirmation emails to, including that of the fax sender
|
||||
if(!empty($row["fax_email_confirmation"])) {
|
||||
$tmp_emails = explode(',', $row["fax_email_confirmation"]);
|
||||
foreach ($tmp_emails as $email) {
|
||||
if(strpos($mail_to_address, $email) === false) {
|
||||
$mail_to_address .= ','.$email;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($row);
|
||||
|
||||
//for email to fax send email notification back to the email sender
|
||||
if ($included) {
|
||||
|
||||
Reference in New Issue
Block a user