aabbb0e5 by Jeff Balicki

invoices

1 parent 8d381d01
......@@ -5,6 +5,8 @@ use Tz\WordPress\CBV;
use Tz\WordPress\CBV\User;
use Tz\WordPress\Tools;
use Tz\WordPress\Tools\Sequencer;
use Tz\WordPress\CBV\Invoice;
const OPTION_NAME = 'notif_options';
const NOTIFICATION_STATUS_READ = 'read';
......@@ -421,6 +423,10 @@ function send_triggered_notification($uid = 0, $trigger = 'NO_TRIGGER', $args =
}
}
if(isset($args['invoice_id'])){
$invoiceView = new Invoice\InvoiceView();
$pdf = $invoiceView->pdf_create($args['invoice_id']);
}
$contents = $email;
......@@ -524,7 +530,9 @@ function send_triggered_notification($uid = 0, $trigger = 'NO_TRIGGER', $args =
$att1 = isset($attachments[0]) ? $attachments[0] : '';
$att2 = isset($attachments[1]) ? $attachments[1] : '';
$att3 = isset($attachments[2]) ? $attachments[2] : '';
if($pdf !=""){
$attachments[0] = $pdf;
}
$attachments = array_map(
function ($attachmentPath) {
return realpath(__DIR__ . '/../../../uploads/notifications/' . $attachmentPath);
......