Kepada:
Nama Pelanggan
Alamat pelanggan.
|
| Deskripsi Perkhidmatan / Produk |
Kuantiti |
Harga Unit |
Jumlah |
function generatePDF() {
const element = document.getElementById('invoice-container'); // ID area invoice Anda
html2pdf().from(element).save('Invoice.pdf');
}
function sendWhatsApp(phoneNumber, message, fileUrl) {
const text = encodeURIComponent(message + "\nDownload invoice di sini: " + fileUrl);
window.open(`https://wa.me/${phoneNumber}?text=${text}`, '_blank');
}
function sendEmail(customerEmail) {
const templateParams = {
to_email: customerEmail,
message: "Terlampir adalah invoice Anda.",
// Link file PDF yang sudah di-upload
link_pdf: "https://your-website.com/path-to-pdf"
};
emailjs.send('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID', templateParams)
.then(function(response) {
alert("Email berhasil dikirim!");
}, function(error) {
alert("Gagal kirim email: " + JSON.stringify(error));
});
}
Comments
Post a Comment