/** * createBatchDetailsNotification() * wrapper-function to create the notification to the customer * * @param array customer information array */ function createBatchDetailsNotification($customerInfo) { global $base; $html = prepareNotificationTemplate($customerInfo); $pdfDocument = createPDF($html); return $pdfDocument; }
/** * createUserDetailsInvoiceNotification() * wrapper-function to create the notification to the customer * * @param array customer information array */ function createUserDetailsInvoiceNotification($customerInfo) { global $base; $html = prepareNotificationTemplate($customerInfo); $pdfDocument = createPDF($html); file_put_contents("{$base}/out4.pdf", $pdfDocument); return $pdfDocument; }
/** * sendWelcomeNotification() * wrapper-function to send notification to the customer * * @param array customer information array * @param array smtp server information * @param string from email address of the sender identity */ function sendWelcomeNotification($customerInfo, $smtpInfo, $from) { global $base; if (empty($customerInfo['customer_email'])) { return; } $headers = array("From" => $from, "Subject" => "Welcome new customer!", "Reply-To" => $from); $html = prepareNotificationTemplate($customerInfo); $pdfDocument = createPDF($html); $mime = new Mail_mime(); $mime->setTXTBody("Notification letter of service"); $mime->addAttachment($pdfDocument, "application/pdf", "notification.pdf", false, 'base64'); $body = $mime->get(); $headers = $mime->headers($headers); $mail =& Mail::factory("smtp", $smtpInfo); $mail->send($customerInfo['customer_email'], $headers, $body); }