diff --git a/cron.php b/cron.php index db30d046..becf81d0 100644 --- a/cron.php +++ b/cron.php @@ -248,15 +248,15 @@ while($row = mysqli_fetch_array($sql_companies)){ $mail->Subject = "Overdue Invoice $invoice_prefix$invoice_number"; $mail->Body = "Hello $contact_name,

According to our records, we have not received payment for invoice $invoice_prefix$invoice_number. Please submit your payment as soon as possible. If you have any questions please contact us at $company_phone.

- Please view the details of the invoice below.

Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Due Date: $invoice_due


To view your invoice online click here


~
$company_name
$company_phone"; + Please view the details of the invoice below.

Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Due Date: $invoice_due


To view your invoice online click here


~
$company_name
Billing Department
$config_invoice_from_email
$company_phone"; $mail->send(); - mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Cron Emailed Overdue Invoice!', history_created_at = NOW(), history_invoice_id = $invoice_id, company_id = $company_id"); + mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Cron Emailed Overdue Invoice', history_created_at = NOW(), history_invoice_id = $invoice_id, company_id = $company_id"); }catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; - mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Cron Failed to send Overdue Invoice!', history_created_at = NOW(), history_invoice_id = $new_invoice_id, company_id = $company_id"); + mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Cron Failed to send Overdue Invoice', history_created_at = NOW(), history_invoice_id = $new_invoice_id, company_id = $company_id"); } //End Mail Try } @@ -370,7 +370,7 @@ while($row = mysqli_fetch_array($sql_companies)){ $mail->isHTML(true); // Set email format to HTML $mail->Subject = "Invoice $invoice_prefix$invoice_number"; - $mail->Body = "Hello $contact_name,

Please view the details of the invoice below.

Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "
Due Date: $invoice_due


To view your invoice online click here


~
$company_name
$company_phone"; + $mail->Body = "Hello $contact_name,

Please view the details of the invoice below.

Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "
Due Date: $invoice_due


To view your invoice online click here


~
$company_name
Billing Department
$config_invoice_from_email
$company_phone"; $mail->send(); diff --git a/post.php b/post.php index c0f415f0..c149a77d 100644 --- a/post.php +++ b/post.php @@ -3132,6 +3132,7 @@ if(isset($_GET['email_quote'])){ $quote_id = $row['quote_id']; $quote_prefix = $row['quote_prefix']; $quote_number = $row['quote_number']; + $quote_scope = $row['quote_scope']; $quote_status = $row['quote_status']; $quote_date = $row['quote_date']; $quote_amount = $row['quote_amount']; @@ -3185,8 +3186,8 @@ if(isset($_GET['email_quote'])){ // Content $mail->isHTML(true); // Set email format to HTML - $mail->Subject = "Quote"; - $mail->Body = "Hello $contact_name,

Thank you for your inquiry, we are pleased to provide you with the following estimate.


Total Cost: " . numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code) . "


View and accept your estimate online here


~
$company_name
$company_phone"; + $mail->Subject = "Quote [$quote_scope]"; + $mail->Body = "Hello $contact_name,

Thank you for your inquiry, we are pleased to provide you with the following estimate.


$quote_scope
Total Cost: " . numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code) . "


View and accept your estimate online here


~
$company_name
Sales
$config_quote_from_email
$company_phone"; $mail->send(); echo 'Message has been sent'; @@ -3673,7 +3674,7 @@ if(isset($_POST['add_payment'])){ // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = "Payment Recieved - Invoice $invoice_prefix$invoice_number"; - $mail->Body = "Hello $contact_name,

We have recieved your payment in the amount of " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . " for invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.

Amount: " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "

Thank you for your business!


~
$company_name
$company_phone"; + $mail->Body = "Hello $contact_name,

We have recieved your payment in the amount of " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . " for invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.

Amount: " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "

Thank you for your business!


~
$company_name
Billing Department
$config_invoice_from_email
$company_phone"; $mail->send(); echo 'Message has been sent'; @@ -3709,7 +3710,7 @@ if(isset($_POST['add_payment'])){ // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = "Partial Payment Recieved - Invoice $invoice_prefix$invoice_number"; - $mail->Body = "Hello $contact_name,

We have recieved partial payment in the amount of " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . " and it has been applied to invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.

Amount: " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "

Thank you for your business!


~
$company_name
$company_phone"; + $mail->Body = "Hello $contact_name,

We have recieved partial payment in the amount of " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . " and it has been applied to invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.

Amount: " . numfmt_format_currency($currency_format, $amount, $payment_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "

Thank you for your business!


~
$company_name
Billing Department
$config_invoice_from_email
$company_phone"; $mail->send(); echo 'Message has been sent'; @@ -3859,12 +3860,12 @@ if(isset($_GET['email_invoice'])){ if($invoice_status == 'Paid'){ $mail->Subject = "Invoice $invoice_prefix$invoice_number Copy"; - $mail->Body = "Hello $contact_name,

Please click on the link below to see your invoice marked paid.

Invoice Link


~
$company_name
Automated Billing Department
$company_phone"; + $mail->Body = "Hello $contact_name,

Please click on the link below to see your invoice marked paid.

Invoice Link


~
$company_name
Billing Department
$config_invoice_from_email
$company_phone"; }else{ $mail->Subject = "Invoice $invoice_prefix$invoice_number"; - $mail->Body = "Hello $contact_name,

Please view the details of the invoice below.

Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Balance Due: " . numfmt_format_currency($currency_format, $balance, $invoice_currency_code) . "
Due Date: $invoice_due


To view your invoice online click here


~
$company_name
$company_phone"; + $mail->Body = "Hello $contact_name,

Please view the details of the invoice below.

Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Balance Due: " . numfmt_format_currency($currency_format, $balance, $invoice_currency_code) . "
Due Date: $invoice_due


To view your invoice online click here


~
$company_name
Billing Department
$config_invoice_from_email
$company_phone"; //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; } @@ -5543,18 +5544,21 @@ if(isset($_POST['add_ticket_reply'])){ // Send e-mail to client if public update & email is setup if($ticket_reply_type == 'Public' && !empty($config_smtp_host)){ - $ticket_sql = mysqli_query($mysqli,"SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_subject FROM tickets - LEFT JOIN clients ON ticket_client_id = client_id - LEFT JOIN contacts ON ticket_contact_id = contact_id - WHERE ticket_id = $ticket_id AND tickets.company_id = $session_company_id"); - $ticket_details = mysqli_fetch_array($ticket_sql); + $ticket_sql = mysqli_query($mysqli,"SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_subject, company_phone FROM tickets + LEFT JOIN clients ON ticket_client_id = client_id + LEFT JOIN contacts ON ticket_contact_id = contact_id + LEFT JOIN companies ON tickets.company_id = companies.company_id + WHERE ticket_id = $ticket_id AND tickets.company_id = $session_company_id + "); + + $row = mysqli_fetch_array($ticket_sql); - $contact_name = $ticket_details['contact_name']; - $contact_email = $ticket_details['contact_email']; - - $ticket_prefix = $ticket_details['ticket_prefix']; - $ticket_number = $ticket_details['ticket_number']; - $ticket_subject = $ticket_details['ticket_subject']; + $contact_name = $row['contact_name']; + $contact_email = $row['contact_email']; + $ticket_prefix = $row['ticket_prefix']; + $ticket_number = $row['ticket_number']; + $ticket_subject = $row['ticket_subject']; + $company_phone = formatPhoneNumber($row['company_phone']); if(filter_var($contact_email, FILTER_VALIDATE_EMAIL)){ @@ -5579,7 +5583,7 @@ if(isset($_POST['add_ticket_reply'])){ $mail->isHTML(true); // Set email format to HTML $mail->Subject = "Ticket update - [$ticket_prefix$ticket_number] - $ticket_subject"; - $mail->Body = "Hello, $contact_name

Your ticket regarding \"$ticket_subject\" has been updated.

--------------------------------
$ticket_reply--------------------------------

Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status

~
$session_company_name"; + $mail->Body = "Hello, $contact_name

Your ticket regarding \"$ticket_subject\" has been updated.

--------------------------------
$ticket_reply--------------------------------

Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status

~
$session_company_name
Support Department
$config_ticket_from_email
$company_phone"; $mail->send(); } catch(Exception $e){