Adjust fax mail_to_address.
For email to fax use the sender email address. Otherwise use the notify email addresses listed on the fax server edit page.
This commit is contained in:
parent
d61939e38a
commit
1ffc8408bd
|
|
@ -28,10 +28,13 @@
|
||||||
Corey Moullas <cmoullas@emak.tech>
|
Corey Moullas <cmoullas@emak.tech>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//set included to boolean
|
||||||
if (!isset($included)) { $included = false; }
|
if (!isset($included)) { $included = false; }
|
||||||
|
|
||||||
|
//check if windows
|
||||||
if (stristr(PHP_OS, 'WIN')) { $IS_WINDOWS = true; } else { $IS_WINDOWS = false; }
|
if (stristr(PHP_OS, 'WIN')) { $IS_WINDOWS = true; } else { $IS_WINDOWS = false; }
|
||||||
|
|
||||||
|
//send email through browser
|
||||||
if (!$included) {
|
if (!$included) {
|
||||||
|
|
||||||
//includes
|
//includes
|
||||||
|
|
@ -124,6 +127,7 @@ if (!function_exists('correct_path')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//define function gs_cmd
|
||||||
if (!function_exists('gs_cmd')) {
|
if (!function_exists('gs_cmd')) {
|
||||||
function gs_cmd($args) {
|
function gs_cmd($args) {
|
||||||
global $IS_WINDOWS;
|
global $IS_WINDOWS;
|
||||||
|
|
@ -134,6 +138,7 @@ if (!function_exists('gs_cmd')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//define function fax_split dtmf
|
||||||
if (!function_exists('fax_split_dtmf')) {
|
if (!function_exists('fax_split_dtmf')) {
|
||||||
function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
|
|
@ -636,30 +641,22 @@ if (!function_exists('fax_split_dtmf')) {
|
||||||
//prepare variables send the fax
|
//prepare variables send the fax
|
||||||
$mail_from_address = (isset($_SESSION['fax']['smtp_from']['text'])) ? $_SESSION['fax']['smtp_from']['text'] : $_SESSION['email']['smtp_from']['text'];
|
$mail_from_address = (isset($_SESSION['fax']['smtp_from']['text'])) ? $_SESSION['fax']['smtp_from']['text'] : $_SESSION['email']['smtp_from']['text'];
|
||||||
|
|
||||||
|
//get the fax mail to address and fax prefix
|
||||||
$sql = "select * from v_fax where fax_uuid = :fax_uuid ";
|
$sql = "select * from v_fax where fax_uuid = :fax_uuid ";
|
||||||
$parameters['fax_uuid'] = $fax_uuid;
|
$parameters['fax_uuid'] = $fax_uuid;
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$row = $database->select($sql, $parameters, 'row');
|
$row = $database->select($sql, $parameters, 'row');
|
||||||
$mail_to_address_fax = $row["fax_email"];
|
$mail_to_address = $row["fax_email"];
|
||||||
$fax_prefix = $row["fax_prefix"];
|
$fax_prefix = $row["fax_prefix"];
|
||||||
unset($sql, $parameters, $row);
|
unset($sql, $parameters, $row);
|
||||||
|
|
||||||
if (!$included) {
|
//for email to fax send email notification back to the email sender
|
||||||
$sql = "select user_email from v_users where user_uuid = :user_uuid ";
|
if ($included) {
|
||||||
$parameters['user_uuid'] = $_SESSION['user_uuid'];
|
|
||||||
$database = new database;
|
|
||||||
$mail_to_address_user = $database->select($sql, $parameters, 'column');
|
|
||||||
unset($sql, $parameters);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//use email-to-fax from address
|
//use email-to-fax from address
|
||||||
}
|
$mail_to_address = $sender_email;
|
||||||
|
|
||||||
if ($mail_to_address_fax != '' && $mail_to_address_user != $mail_to_address_fax) {
|
|
||||||
$mail_to_address = $mail_to_address_fax.",".$mail_to_address_user;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mail_to_address = $mail_to_address_user;
|
//send fax through the browser
|
||||||
}
|
}
|
||||||
|
|
||||||
//move the generated tif (and pdf) files to the sent directory
|
//move the generated tif (and pdf) files to the sent directory
|
||||||
|
|
@ -798,6 +795,7 @@ if (!function_exists('fax_split_dtmf')) {
|
||||||
} //end upload and send fax
|
} //end upload and send fax
|
||||||
|
|
||||||
|
|
||||||
|
//show content in the browser
|
||||||
if (!$included) {
|
if (!$included) {
|
||||||
|
|
||||||
//retrieve current user's assigned groups (uuids)
|
//retrieve current user's assigned groups (uuids)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue